← Back to issue list

fix(extensions/ros): fix ros 2 extension core26

View original Github issue

Metadata

Project
snapcraft
Number
#6315
Type
pull request
State
merged
Author
giusebar
Labels
PR: Run Manual Spread
Created
Updated
Closed

Current evaluation

Merged fix for the ROS 2 extension on Core 26. Added a no-op all target to the launch Makefile to prevent empty DESTDIR install failures. Reordered command-chain exports to ensure python3 is on PATH before sourcing workspaces, resolving runtime errors.

Suggested action:

No scores available.

Issue body

- Add a no-op all: default target to the shared ROS 2 launch Makefile so the [make plugin](https://github.com/canonical/craft-parts/blob/main/craft_parts/plugins/make_plugin.py#L92-L98)'s first invocation (bare make, run before make install) no longer triggers the install recipe with an empty `DESTDIR`. On core26 this is causing the following failure: ``` :: + make -j24 :: install -D -m755 launch ""/snap/command-chain/ros2-launch :: install -D -m755 ros2 ""/ros2 :: install: No such file or directory :: make: *** [Makefile:5: install] Error 1 ``` On core26 the base ships uutils coreutils instead of GNU coreutils. With install as the default target, the first run executed `install -D -m755 ros2 "$(DESTDIR)"/ros2` with an empty `DESTDIR`, resolving to `/ros2`, destination whose parent is the filesystem root /. An issue with coreutils https://github.com/uutils/coreutils/issues/13232 makes the file disappear from the expected location. That was not happening in core24. Also change the phony targets to match the makefile commands as specified in the https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_node/make_34.html. - This PR also reorders the shared ROS 2 launch command-chain script so the underlay's PATH/LD_LIBRARY_PATH exports run before the underlay ROS 2 workspaces are sourced, instead of after. On core26 a minimal content-sharing (meta) snap fails at runtime with: ``` env: 'python3': No such file or directory env: use -[v]S to pass options in shebang lines error: unable to find fallback python3 executable error: unable to find python3 executable ``` When sourcing local_setup.bash itt shells out to python3 to run _local_setup_util.py (#!/usr/bin/env python3) to compute the ordered environment. So entering any ROS 2 workspace requires python3 on `PATH` at source time, even for a C++ node. For a content-sharing meta snap the only python3 lives in the underlay at `$SNAP/opt/ros/underlay_ws/usr/bin`, hence the sourcing must be done after the PATH is updated. This did not surface on core22 (humble) or core24 (jazzy) because those bases ship /usr/bin/python3 (python3.10 / python3.12). - Fixes on spread tests for core26. --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [x] I've successfully run `make lint && make test`. - [x] I've added or updated any relevant documentation. - [x] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing. - [x] I've updated the relevant release notes.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged fix for the ROS 2 extension on Core 26. Added a no-op all target to the launch Makefile to prevent empty DESTDIR install failures. Reordered command-chain exports to ensure python3 is on PATH before sourcing workspaces, resolving runtime errors.
qwen3.6-35b-a3b-mtp-q6
Staleness: 5
Complexity: 15
Confidence: 90
needs review Adds a no-op all: default target to the ROS 2 launch Makefile to prevent make from triggering the install recipe with an empty DESTDIR on core26, fixing a uutils/coreutils compatibility failure. Awaiting maintainer review.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#4019 extension: use minimum necessary build packages for ros foxy extension (core20) snapcraft merged Merged optimization for ROS 2 Foxy extension build packages on core20. The update also fixed a bug where ROS underlay environments were not properly sourced, applying the fix to core20 and core22.
72%
#4791 extension: add ROS 2 Jazzy (core24) snapcraft merged Merged the ROS 2 Jazzy extension for core24. Approved by reviewers, the change modifies 13 files with 722 additions and 20 deletions. CI passed after updating codespell dependencies to resolve legacy flagging.
70%