colcon / colcon-ros

Extension for colcon to support ROS packages
http://colcon.readthedocs.io
Apache License 2.0
13 stars 26 forks source link

[question] colcon build handling of directories containing CATKIN_IGNORE files #137

Open DavidATapia opened 2 years ago

DavidATapia commented 2 years ago

The colcon build command will skip directories containing a COLCON_IGNORE file, which is the expected (and desired) behavior. The colcon build command however also skips directories containing a CATKIN_IGNORE file, which is not necessarily the expected behavior.

My question is whether colcon build should really treat COLCON_IGNORE and CATKIN_IGNORE equivalently and if this is viewed as the desired behavior for colcon.

This lack of a distinction between COLCON_IGNORE and CATKIN_IGNORE seems to impose some unnecessary limitations when laying out a migration path from a ROS1 codebase to ROS2. It doesn't allow for phasing out catkin_make in a codebase having both ROS1 and ROS2 packages. Instead, it seems to assume the adoption of colcon for building all ROS package types (1 & 2) which would require updating all ROS1 CMakeLists.txt with the updated install-space from the get-go -- or otherwise forces a need to maintain migrated ROS2 components in a separate top-level folder that has its own ./src directory.

Is this lack of a distinction between COLCON_IGNORE and CATKIN_IGNORE really the intended and desired behavior for colcon build?

cottsay commented 2 years ago

You should be able to use colcon to build catkin packages just fine, meaning you could migrate from catkin_make to colcon independent of migrating from ROS 1 to ROS 2. Please take a look at this article, which discusses the goals of colcon and how it differs from catkin, which serves as both a build tool and a build system.

which would require updating all ROS1 CMakeLists.txt with the updated install-space from the get-go

I'm not sure what you're describing here, but it shouldn't be necessary. Could you please elaborate?

DavidATapia commented 2 years ago

Yeah, but the larger point I'm making is that changing the build system across potentially hundreds of packages all at once isn't something that should be necessary before even starting the real migration process. I should be able to do that piecemeal as I'm migrating specific packages and evaluating whether ROS2 adoption makes sense in the long run. Requiring a full build system migration first is a huge turn-off. There is an outstanding PR to fix this, but seems to have been completely ignored by the maintainers. So I can't help but wonder why the resistance and flawed group-think around something simple enough to address? The most sensible work-around that I can see for the time being, is to have two "src" directories to maintain ROS1 and ROS2 separation.

Getting back to the original question, why not simply allow for a distinction between CATKIN_IGNORE and COLCON_IGNORE directives? This would be the obvious behavior to adopt that would actually follow the principle of least surprise.