ROS 2 plugins v2 misc fixes
Metadata
Current evaluation
Merged #3566 via 6f80a4cee, fixing ROS 2 v2 install paths and local-package staging, with new spread tests.
Resolution: closed resolved
Reason: PR #3566 was merged as 6f80a4cee. It separated colcon output, detected local ROS packages during staging, skipped unnecessary rosdep resolution, and added spread-test coverage.
Evaluated by: mr-cal-bot
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 |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged #3566 via 6f80a4cee, fixing ROS 2 v2 install paths and local-package staging, with new spread tests. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #3566 (6f80a4cee), fixing ROS 2 v2 install paths and local-package staging, with spread-test coverage. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in 6f80a4cee (#3566): fixed ROS 2 v2 workspace isolation and local-package staging, removed COLCON_IGNORE after builds, and added spread tests. | |
| 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. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/snapcraft#3536
(confidence 100%)
Merged predecessor PR that fixed analogous ROS plugin v2 issues; #3566 explicitly follows it.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3536 ROS plugins v2 misc fixes | snapcraft | merged | Merged ROS v2 plugin fixes to detect local ROS packages in the part install or underlay and skip rosdep resolution for them, with added core20 spread coverage. | |
| #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. | |
| #3405 [feature] ROS plugins v2 out of source tree builds | snapcraft | merged | Merged #3405 (commit c074de797), enabling ROS plugins v2 out-of-source builds so snapcraft.yaml can be placed in a ROS package root. | |
| #3570 ROS V2 plugins: resolve conditional dependencies | snapcraft | merged | Merged PR #3570 in commit 1fa5484b9, enabling ROS V2 plugins to resolve package.xml dependencies conditioned on ROS_VERSION, ROS_DISTRO, or ROS_PYTHON_VERSION. | |
| #6315 fix(extensions/ros): fix ros 2 extension core26 | snapcraft | merged | Merged as 429f62894, fixing ROS 2 core26 builds by making bare make a no-op, ordering underlay PATH setup before workspace sourcing, and updating spread tests. |