core22 colcon plugin: re-source environment after installation (#3994)
Metadata
Current evaluation
Backported the core22 colcon fix in #3994: source ROS 2 after dependency installation. PR #4054 merged via d634246 into hotfix/7.3, with new spread coverage.
Resolution: closed resolved
Reason: PR #4054 was merged into hotfix/7.3 at d634246, backporting merged PR #3994. It re-sources the ROS 2 environment after dependency installation and adds regression spread coverage for custom interface builds.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Core22 ROS 2 colcon snaps couldn't build packages creating custom ROS 2 interfaces. It was sourcing the environment before downloading the dependencies. Some dependencies (rosidl) have specificities when sourced, hence sourcing before downloading them causes issues.
In the case of ROS 2 message, the PYTHONPATH only had the site-packages subdir and not the dist-packages subdir added by rosidl.
This issue couldn't appear with lxd spread tests because the lxd environment was not cleaned properly by colcon spread tests (Debian packages were still installed, hence the dependencies were mostly already installed).
Additionally, the advanced colcon spread tests had no entry in the spread.yaml and were never called.
Hence, this code:
- Adds missing spread entry for colcon specific tests
- Adds package-utils.sh to restore the state of Debian package installed before a spread tests
- Adds a colcon spread test with a message package to highlight that there is a bug
- Fixes the bug by sourcing the ROS 2 environment after installing the ROS 2 dependencies
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `make lint`?
- [ ] Have you successfully run `pytest tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Backported the core22 colcon fix in #3994: source ROS 2 after dependency installation. PR #4054 merged via d634246 into hotfix/7.3, with new spread coverage. | |
| stealth/space-bunny-alpha | — | closed resolved | Backported the core22 colcon fix in #4054 (commit 95cf193ce), re-sourcing ROS 2 after dependency installation and adding spread coverage for custom message builds. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged as #4054 into hotfix/7.3, fixing core22 colcon to re-source ROS 2 after dependency installation and adding spread coverage for custom interface builds. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged PR resolves Core22 colcon plugin bug where premature ROS 2 environment sourcing caused PYTHONPATH errors for custom interfaces. Fixed by re-sourcing after dependency installation. Also adds missing spread tests and a package state helper script. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix for the core22 colcon plugin resolving custom ROS 2 interface build failures by re-sourcing the environment after dependency installation. Added spread tests and helper scripts. Merged into hotfix/7.3. |
Update history
No update history recorded yet.
Related work
-
Related To:
snapcraft#3994
(confidence 100%)
Original merged fix backported by PR #4054.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3994 core22 colcon plugin: re-source environment after installation | snapcraft | merged | Merged #3994, moving ROS 2 environment sourcing until after colcon dependencies are installed. It also added package-state cleanup and regression spread coverage for custom ROS 2 interfaces. | |
| #2456 plugins: add colcon plugin | snapcraft | merged | PR #2456 by kyrofa merged (commit cd9516b56) adding a new beta colcon plugin for ROS 2 builds, resolving LP bug #1805213; later extended by #2486, #2593, #2670, #2687 and #2981. | |
| #3750 Add core22 colcon plugin / ros2-humble extension | snapcraft | merged | Merged into main as commit 2013e0e18, adding the core22 colcon plugin and ros2-humble extension. | |
| #3113 colcon: use packages.ros.org/ros2 repository | snapcraft | merged | Merged PR #3113 (commit d76f466f6) switched the colcon plugin from the broken repo.ros2.org apt source to packages.ros.org/ros2. | |
| #6190 Add core26 support for the colcon plugin and extensions | snapcraft | open | Core26 support for colcon-based ROS extensions is implemented, including the ROS 2 Lyrical extension and subsequent ROS 2 compatibility fixes; the placeholder can be closed. | |
| #3097 colcon v2 plugin + ros2 extension | snapcraft | closed | Closed unmerged and superseded by #3203, which added experimental ROS 2 Foxy support and the colcon v2 plugin in commit 88cc08fad. | |
| #1805213 Support the new ros2 build tool colcon | snapcraft (launchpad) | closed | Added and merged the beta colcon plugin for ROS 2 builds in snapcore/snapcraft#2456 (commit cd9516b56), resolving LP bug #1805213. | |
| #3664 ROS plugins v2: respect source-subdir key | snapcraft | merged | Merged PR #3664, with commit 09eb744e5, made ROS v2 Colcon/catkin plugins respect source-subdir, removed a redundant dependency, and added subdirectory tests. |