0
$\begingroup$

Rosanswers logo

Hello,

I am using ROS 2 bouncy built from source on Ubuntu 18.04 and I was wondering if there was a command to only build the modified packages with colcon similar to how catkin worked (tell me if I'm wrong ??) on ROS 1 ?

I found the colcon build --packages-select <name-of-pkg> command to only build the selected package and the colcon build --packages-up-to <name-of-pkg> to build the selected package and ALL its dependencies but it will still rebuild things like rclcpp, fastrtps and co...


Originally posted by Marc Testier on ROS Answers with karma: 203 on 2018-07-29

Post score: 2


Original comments

Comment by Geoff on 2018-07-29:
Which catkin command are you referring to that you want an equivalent for?

Comment by Marc Testier on 2018-07-29:
Haven't use ros 1 in quite some time, but I remember that catkin_make would just build the modified packages ?

Comment by Dirk Thomas on 2018-07-29:
catkin_make is different because it invokes CMake only once and within CMake adds the directory of each package. This approach doesn't scale well since it might have colliding target names across packages as well as each package must declared cross packages dependencies.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I'm still relatively new to colcon myself, but as I understand it, it does not know what is inside a package other than what build system it uses, and so has no way to know if a package is modified or not. That is up to each package's own build scripts. If each package can skip its own build if there is nothing to do (as most build systems do), then colcon will merely be calling a build script that does nearly nothing and returns. It's not as fast as colcon doing the skipping, but you shouldn't be seeing packages being actually rebuilt when there is nothing changed.


Originally posted by Geoff with karma: 4203 on 2018-07-29

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Marc Testier on 2018-07-29:
Indeed, I can't reproduce it, the command doesn't rebuild all the packages. I must have make a wrong manipulation at one point that made everything rebuild. Thanks for your time.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.