ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Ignore package in colcon but not catkin?

asked 2018-10-24 08:00:31 -0600

lucasw gravatar image

updated 2018-10-24 08:04:06 -0600

catkin ignores packages when they have COLCON_IGNORE in them. ( )

I'd like to have ros1 and ros2 packages in parallel in two subdirectories of the same git repository and not get this error:

CMake Error at CMakeLists.txt:4 (find_package):
  By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "catkin", but
  CMake did not find one.

  Could not find a package configuration file provided by "catkin" with any
  of the following names:


--packages-skip exists but has to be typed in every time there is a build, I don't see a blacklist option to add to a colcon config to ignore it for all following builds.

Building with catkin produces (more innocuous) warnings:

[build] Warning: Skipping package `foo2` because it has an unsupported package build type: `ament_cmake`
[build] Note: Available build types:                                                               
[build]  - `cmake`                                                                                 
[build]  - `catkin`

And then those can be eliminated with --blacklist.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-11-02 11:56:51 -0600

lucasw gravatar image

updated 2018-11-03 08:18:49 -0600


sudo apt install python3-colcon-mixin


  "build": {
    "skip": {
      "packages-skip": ["foo1",


    - skip.mixin


colcon mixin add skip file://`pwd`/src/my/mixins/index.yaml
colcon mixin update skip
fetching links: file:///home/lucasw/ros2_ws/src/my/mixins/index.yaml ...
  fetching file:///home/lucasw/ros2_ws/src/my/mixins/skip.mixin ...
  * /home/lucasw/.colcon/mixin/skip/skip.mixin

And run update if the index or mixin file/s change, and build with

colcon build --mixin skip

More on colcon mixins:

edit flag offensive delete link more



Hopefully in the near future you won't need to create your own local index.yaml for this but can just pass --mixin-file path/to/skip.mixin...

Dirk Thomas gravatar image Dirk Thomas  ( 2018-11-02 12:00:12 -0600 )edit

The mixing doesn't provide persistence either and seems to be more effort than the options mentioned in the other answer.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-11-03 11:29:37 -0600 )edit

answered 2018-10-24 08:56:29 -0600

Dirk Thomas gravatar image

The build tool is not a valid criteria for concluding if a build is for ROS 1 or ROS 2 (e.g. you can use colcon to build a ROS 1 workspace).

Generally it is not a workflow we recommend - to keep ROS 1 and ROS 2 packages on the same branch - so it will likely not be supported in all cases.

You could check the ROS_VERSION environment variable and make a decision about "skipping" a package in it's CMake logic. But as I said that is more like a hack and you might run into problems going down that path.

edit flag offensive delete link more


Will there be a colcon --blacklist?

lucasw gravatar image lucasw  ( 2018-10-24 09:14:49 -0600 )edit

There are already the options --packages-ignore (to skip packages during discovery, same as a *_IGNORE file) as well as --packages-skip and --packages-skip-regex (to deselect discovered packages).

Dirk Thomas gravatar image Dirk Thomas  ( 2018-10-24 09:28:39 -0600 )edit

But no persistence of those kinds of settings in a build.yaml/config.yaml as with catkin?

lucasw gravatar image lucasw  ( 2018-10-24 12:34:16 -0600 )edit

At the moment there is no "profile" / "default mixin". You could create a mixin file manually to aggregate multiple command line options and select it explictly (--mixin mymixin) but that would still require to at least pass that argument - so not very convenient.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-10-24 13:17:02 -0600 )edit

There's an enhancement suggestion for this feature here

jrgnicho gravatar image jrgnicho  ( 2020-01-13 12:57:54 -0600 )edit

@jrgnicho your link points to a repository which has no issues or pull requests open?

Dirk Thomas gravatar image Dirk Thomas  ( 2020-01-13 13:08:17 -0600 )edit
jrgnicho gravatar image jrgnicho  ( 2020-02-19 14:33:45 -0600 )edit

Question Tools



Asked: 2018-10-24 08:00:31 -0600

Seen: 5,463 times

Last updated: Nov 03 '18