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

Do I have to rebuild all my packages when switching ROS Distro?

asked 2021-09-27 21:41:51 -0600

ijnek gravatar image

I have both Foxy and Galactic installed on my computer. I usually use Galactic, but accidentally built a workspace with Foxy enabled (and galactic disabled).

Do I have to run rm -rf build/ install/ log/ and build from scratch again to build for galactic?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-09-28 01:36:50 -0600

gvdhoorn gravatar image

updated 2021-09-28 02:17:46 -0600

Yes , I would strongly suggest you do you should.

Languages which get compiled and linked to other binary artefacts (such as C++, but even Python and/or Python modules with native parts) will contain all sorts of references to Foxy-specific versions of those artefacts (ie: libraries).

Locations of other resources will also end up in your nodes and other (non-)executable pieces.

I would be surprised if a workspace compiled with Foxy would actually work with Galactic, or vice-versa.


Edit: and to make it even stronger: you are actually required to rebuild your workspace every time you update your ROS installation. Meaning: every time you sudo apt update and ROS packages get updated, you should rebuild your workspace.

We've discussed this quite a few times here on ROS Answers, but to summarise: there is no ABI compatibility guarantee between (re)builds of ROS packages at the moment (neither ROS 1, nor ROS 2). So after updating ROS packages, there is no guarantee your workspace binary artefacts are compatible with their dependencies any more.

In a way, going from Foxy -> Galactic could be considered "updating your packages", so the same applies in that situation.

edit flag offensive delete link more

Comments

@gvdhoorn That was a very concise answer, thank you!

ijnek gravatar image ijnek  ( 2021-09-30 18:38:32 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2021-09-27 21:41:51 -0600

Seen: 564 times

Last updated: Sep 28 '21