An extension for colcon-core to provide custom default values for the command line arguments from a configuration file.
For more information about the format of the configuration file see colcon.readthedocs.io.
Extension for colcon to read defaults from a config file
Home Page: http://colcon.readthedocs.io
License: Apache License 2.0
An extension for colcon-core to provide custom default values for the command line arguments from a configuration file.
For more information about the format of the configuration file see colcon.readthedocs.io.
Currently, I specify options to a list like:
{
"build": {
"mixin": [ "ccache", "rel-with-deb-info" ]
}
}
then it works just fine, but if I add an additional option to the list via the CLI like:
colcon build --mixin asan-gcc
then the whole list is ignored from my config file, which is rather inconvenient: you must use either all of the defaults and no more, or none of the defaults.
If the lists from the config files were simply merged with options provided on the CLI, then my use case would be easier, but the only way to disable the defaults would be to use --ignore-user-meta
, which will apply to all of your defaults, not just one list.
Version tag 0.2.7
released for Debian 10 / 11 doesn't seem to be installable due to zstd
missing in the respective dpkg
versions (1.19.8
in Debian 10, 1.20.12
in Debian 11).
The installation fails as follows:
dpkg-deb: error: archive '/tmp/apt-dpkg-install-Hy5Zg5/1-python3-colcon-defaults_0.2.7-1_all.deb' uses unknown compression for member 'control.tar.zst', giving up
According to packages.ros.org
the package has been released in this state as follows:
However, ROS 2 / Debian 11 0.2.5-1
installs just fine.
Please let me know if there is a more appropriate place to discuss this.
I have a weird specific case, the cmake-args are ignored from defaults.yaml when the mixin argument is present:
Steps to reproduce:
root@logi-XMG-CORE-REN-M20:/code/deep_cv# colcon build --mixin ccache --packages-select amr_pcl_filter --event-handlers console_direct+
[0.439s] WARNING:colcon.colcon_core.verb:Some selected packages are already built in one or more underlay workspaces:
'amr_pcl_filter' is in: /code/ros2_ws/install/amr_pcl_filter
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.
If you understand the risks and want to override a package anyways, add the following to the command line:
--allow-overriding amr_pcl_filter
This may be promoted to an error in a future release of colcon-core.
Starting >>> amr_pcl_filter
-- The C compiler identification is GNU 9.4.0
.
.
.
.
[ 50%] Building CXX object CMakeFiles/passthrough.dir/src/passthrough.cpp.o
[ 50%] Building CXX object CMakeFiles/plane_clipper.dir/src/plane_clipper.cpp.o
[100%] Linking CXX executable passthrough
[100%] Linking CXX executable plane_clipper
[100%] Built target passthrough
[100%] Built target plane_clipper
-- Install configuration: ""
The Install configuration is not "Release"
However when inserting the cmake args in the command without any defaults.yaml configuration file, it works as expected, the Install Configuration is Release:
root@logi-XMG-CORE-REN-M20:/code/deep_cv# colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --mixin ccache --packages-select amr_pcl_filter --event-handlers console_direct+
[0.458s] WARNING:colcon.colcon_core.verb:Some selected packages are already built in one or more underlay workspaces:
'amr_pcl_filter' is in: /code/ros2_ws/install/amr_pcl_filter
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.
If you understand the risks and want to override a package anyways, add the following to the command line:
--allow-overriding amr_pcl_filter
This may be promoted to an error in a future release of colcon-core.
Starting >>> amr_pcl_filter
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
.
.
.
.
[ 50%] Building CXX object CMakeFiles/passthrough.dir/src/passthrough.cpp.o
[100%] Linking CXX executable passthrough
[100%] Linking CXX executable plane_clipper
[100%] Built target plane_clipper
[100%] Built target passthrough
-- Install configuration: "Release"
-- Installing: /code/deep_cv/install/amr_pcl_filter/lib/amr_pcl_filter/passthrough
-- Set runtime path of "/code/deep_cv/install/amr_pcl_filter/lib/amr_pcl_filter/passthrough" to ""
-- Installing: /code/deep_cv/install/amr_pcl_filter/lib/amr_pcl_filter/plane_clipper
-- Set runtime path of "/code/deep_cv/install/amr_pcl_filter/lib/amr_pcl_filter/plane_clipper" to ""
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/config
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/config/params.yaml
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/ament_index/resource_index/package_run_dependencies/amr_pcl_filter
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/ament_index/resource_index/parent_prefix_path/amr_pcl_filter
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/environment/ament_prefix_path.sh
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/environment/ament_prefix_path.dsv
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/environment/path.sh
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/environment/path.dsv
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/local_setup.bash
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/local_setup.sh
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/local_setup.zsh
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/local_setup.dsv
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/package.dsv
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/ament_index/resource_index/packages/amr_pcl_filter
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/cmake/amr_pcl_filterConfig.cmake
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/cmake/amr_pcl_filterConfig-version.cmake
-- Installing: /code/deep_cv/install/amr_pcl_filter/share/amr_pcl_filter/package.xml
--- stderr: amr_pcl_filter
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
---
Finished <<< amr_pcl_filter [3.66s]
Summary: 1 package finished [3.92s]
1 package had stderr output: amr_pcl_filter
Colcon only supports per-verb config options in defaults.yaml, and --log-base
, --log-level
are only accepted at the pre-verb stage.
This works: colcon --log-base /dev/null list
This fails with "unrecognized arguments": colcon list --log-base /dev/null
Adding this to defaults.yaml
is silently ignored:
list:
<<: *paths
log-base: /dev/null
I expect that:
--log-base
in colcon.yaml
colcon.yaml
should not be silently ignored; there should be a visible warning message.I'm interested in specifying defaults for all the packages in a workspace (e.g., --merge-install
) without using command line arguments. I definitely don't have a thorough understanding of the colcon universe so maybe something to do this already exists, but all I saw were options to either set defaults globally or individually on package names/paths. It would seem pretty easy to have this package check for a defaults.yaml
(colcon_defaults.yaml
?) in the workspace root directory and apply those on top of the global defaults.
Is this something that would be desirable, assuming there isn't already a solution to the workspace default issue?
It looks like the defaults.yaml
file is processed before the parser has been populated. So the default values generate warnings and are not passed ot the relevant verb.
Following the documentation:
{
"build": {
"symlink-install": true
}
}
colcon build --packages-select rcutils
Default defined in defaults.yaml are recognized and passed to the build verb
Prints: WARNING:colcon.colcon_defaults.argument_parser.defaults:Unknown configuration option 'build.symlink-install'
And the default value is not passed to the verb so no symlink install is performed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.