Skip to content

Providing multiple mixins concatenates lists in reverse order #40

@asasine

Description

@asasine

When using multiple mixins that each define cmake-args, the order they are concatenated is in the reverse order they are listed in the mixin list.

Given these mixins:

index.yaml

mixin:
  - a.mixin
  - b.mixin

a.mixin

{
    "build": {
        "a": {
            "cmake-args": [
                "-DFOO=A"
            ]
        }
    }
}

b.mixin

{
    "build": {
        "b": {
            "cmake-args": [
                "-DFOO=B"
            ]
        }
    }
}

and this command:

colcon build --mixin a b

the executed cmake command for every package looks like this:

Invoking command in '/path/to/package/build/package': /usr/bin/cmake /path/to/package/src -DFOO=B -DFOO=A ...

Since the order provided to cmake is -DFOO=B -DFOO=A, the value of FOO is A when in cmake's configure step. This is the reverse of the order provided to --mixin a b as I expected. Is this a bug or by design?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions