Skip to content

Relationship of defaults.yaml to command line and to mixins is unclear #44

@StephenApptronik

Description

@StephenApptronik

The documentation of defaults.yaml is sparse:
https://colcon.readthedocs.io/en/released/user/configuration.html#defaults-yaml
I would like to know how the system is supposed to work and whether the following behavior is a bug/has any workarounds.

What we have observed: Suppose we have a defaults.yaml file of this:

{
    "build": {
        "cmake-args": [
            "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
            "-DCMAKE_CXX_FLAGS=' -Werror=suggest-override -Wunused-variable -Wuninitialized -Wshadow -Wformat-security -Wswitch-default -Wparentheses -Wsign-conversion -Werror -I/usr/include/c++/11 -I/usr/include/x86_64-linux-gnu/c++/11 -I/usr/lib/gcc/x86_64-linux-gnu/11/include '"
        ]
    }
}

If we build with colcon build then everything works as expected. But if we do this:
colcon build --cmake-args "-DCMAKE_BUILD_TYPE=Debug"
then we lose all the warning flags. Similarly, if we do this:
colcon build --mixin customthing
We also lose the defaults. Now, the first case kind of makes sense -- the command line overrode all the cmake instructions and replaced them. What's unclear is why they second one also tossed out the defaults.yaml values.

Is there any way to have parameters at the command line that add to the defaults.yaml? I do not want to have to copy out the entire defaults set everytime I want to change one thing in the set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions