ROS 2 plugins v2 misc fixes
Metadata
Current evaluation
Merged after resolving conflicts and passing CI. Fixes ROS 2 plugins v2 by updating the colcon install path, resolving local packages during staging by removing the COLCON_IGNORE marker, and adding spread tests.
Suggested action: —
No scores available.
Issue body
This PR is a follow-up on #3536 and essentially fixes the same issues for ROS 2 plugins v2.
This PR most notably,
- changes the colcon install path from `$SNAPCRAFT_PART_INSTALL` to `$SNAPCRAFT_PART_INSTALL/opt/ros/snap` for a cleaner separation of ROS 2 workspaces (similar to what's in the v1 plugin).
- looks for ROS 2 packages in `$SNAPCRAFT_PART_INSTALL/opt/ros/snap` in case the workspace exists (e.g. provided by a stage-snap) during the build step
- does not `rosdep resolve` packages that are available locally in `$SNAPCRAFT_PART_INSTALL` during stage step. Such locally available package may be part of the built sources or provided by a stage-snap. Furthermore, it fixes the following current issue; if the source contains packages `foo` & `bar` - two packages that are not released in the rosdistro database - where `foo` depends on `bar`, staging fails as it tries to `rosdep resolve` the `bar` key (which does not exists since it is not released). With this fix, it finds `bar` locally and thus does not try to resolve it. This issue is fixed by deleting the `${SNAPCRAFT_PART_INSTALL}/opt/ros/snap/COLCON_IGNORE` marker file - if it exists - right after the actual build command. This marker file prevents catkin from crawling the directory while looking for packages during staging.
- adds `test-snapcraft-fake-ros2-package-core20` snap and `colcon-stage-snaps` snap/spread test to test the above bullet points.
Note:
- I own the `test-snapcraft-fake-ros2-package-core20` snap that's used in the new spread test, I imagine we should transfer ownership.
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged after resolving conflicts and passing CI. Fixes ROS 2 plugins v2 by updating the colcon install path, resolving local packages during staging by removing the COLCON_IGNORE marker, and adding spread tests. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged after resolving master conflicts. The update fixes ROS 2 plugins v2 by adjusting colcon install paths, enabling local package resolution during staging, and removing the COLCON_IGNORE marker to prevent build failures. Tests passed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged ROS 2 plugins v2 build and staging fixes, updating colcon paths, enabling local rosdep resolution, and handling COLCON_IGNORE markers. Tests added. Merged despite unrelated CI failure, conflicts resolved post-merge. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3536 ROS plugins v2 misc fixes | snapcraft | merged | Merged. Fixes ROS plugins v2 staging failures by checking local ROS directories and skipping rosdep resolution for locally available packages. Updated tests for core20. Approved by two reviewers and passed CI. | |
| #2456 plugins: add colcon plugin | snapcraft | merged | Merged the colcon plugin for ROS2 builds, resolving LP: #1805213. Added as a beta feature, the change was approved by two reviewers, passed CI with 100% diff coverage, and introduced 2120 lines across 16 files. | |
| #3994 core22 colcon plugin: re-source environment after installation | snapcraft | merged | Merged fix for core22 colcon plugin that re-sources ROS 2 environment post-installation to resolve custom interface build failures. Added spread tests and package state restoration. Approved by two reviewers and merged. | |
| #3664 ROS plugins v2: respect source-subdir key | snapcraft | merged | Merged. Updates ROS plugins v2 to respect the source-subdir key, removes an unnecessary catkin_tools dependency, and adds tests for Colcon and catkin v2 subdir handling. Approved by reviewers and passed CI. | |
| #2835 colcon plugin: support ROS 2 Eloquent | snapcraft | merged | Merged after adding ROS 2 Eloquent Elusor support to the colcon plugin. Approved by two reviewers, passed CI checks, and updated two files with minimal changes. | |
| #3097 colcon v2 plugin + ros2 extension | snapcraft | closed | Closed without merging. The colcon v2 plugin and ros2 extension request remained in pending review with 50 unresolved comments and no CI checks, indicating it was abandoned. | |
| #3095 plugins: break out rosdep resolve parsing for external use | snapcraft | merged | Merged. Extracted rosdep resolve parsing logic for external use by the colcon v2 plugin. Approved by one reviewer, passed CI checks, and modified one file (+34/-27). | |
| #4054 core22 colcon plugin: re-source environment after installation (#3994) | snapcraft | merged | 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. | |
| #3268 v2 plugins: add catkin plugin | snapcraft | merged | Merged after passing review and CI checks. Introduced a new Catkin plugin using the v2 plugin API and refactored shared code from the Colcon plugin. Additional spread tests were added to verify all plugin options. | |
| #3203 experimental ros2 extension & colcon v2 plugin | snapcraft | merged | Merged experimental ROS2 extension and colcon v2 plugin. Rebased and approved to enable Foxy support. Integrated into master with 790 lines added across 16 files. |