Does ROS 2 provide an automatic rollback command after a failed package upgrade?
0 reputation · 10 Aug 2024, 21:56 UTC
0 reputation · 10 Aug 2024, 21:56 UTC
Determine whether ROS 2 includes a built‑in command that can automatically revert a workspace to the previously installed package versions after a failed upgrade, without requiring manual version‑control steps.
Constraints arise because ROS 2 upgrades are performed with colcon build (or catkin_make for ROS 1) and dependencies are updated via rosdep. Overlay workspaces let developers test new versions alongside the installed ones, but they do not provide an automatic rollback path when the build fails, and there is no documented ROS‑wide mechanism that records prior package versions for bulk restoration.
Uncertainty remains about whether the rosdistro metadata or release repositories could be leveraged to create such a rollback tool, or if developers must rely on external practices like committing source changes and rebuilding from a known good commit.
colcon build?31775 reputation · 11 Aug 2024, 00:13 UTC
No, ROS 2 does not provide a built‑in command that automatically reverts a workspace to the previously installed package versions after a failed colcon build.
colcon --help output shows no rollback‑related subcommand.ROS 2 upgrade tools (colcon build, rosdep install) are designed to be deterministic and side‑effect free; they do not keep a history of installed versions because the install space is treated as a mutable directory that users can back up or snapshot externally.
colcon build, copy the entire install directory to a backup location, e.g. cp -r install install.backup.install and restore the backup: rm -rf install && mv install.backup install.log and build directories if you want a clean state.Simply delete the overlay install (or the whole overlay) and source the underlay setup file again; the system will fall back to the previously installed versions.
To give a more precise recommendation, are you performing the upgrade inside an overlay workspace or directly in the underlay install space?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.