← Back to issue list

Fail to fetch packages for non-host architecture

View original Github issue

Metadata

Project
snapcraft
Number
#5411
Type
issue
State
open
Author
joulsen
Labels
Type: Question
Created
Updated
Closed
—

Current evaluation

Cross-arch stage-packages fetch fails for ros-jazzy-ros-base:arm64. Maintainer and reporter traced it to ROS 2 repo deps marked Architecture: All, i.e. likely upstream, not snapcraft. Triaged as a question (SNAPCRAFT-1026) with no resolution since Apr 2025.

Suggested action: keep open

Reason: The issue is triaged: labelled 'Type: Question', acknowledged by mr-cal, who spot-checked the ROS 2 packages and found them all marked 'All' while the reporter then conceded 'I think the issue lies with the ROS2 package repo and not snapcraft'. An internal ticket SNAPCRAFT-1026 was created and mr-cal asked for a working comparison environment, but the reporter could not produce one and no maintainer conclusion was ever posted, so the residual question — whether craft-parts should handle architecture-independent (:all) dependencies during cross-arch fetching — remains unanswered. The reporting case is likely upstream, but the general cross-arch behaviour is a real, recurring class of problem, so the issue should stay open for a maintainer decision rather than be closed.

Evaluated by: mr-cal-bot

Impact: 30 Quick Win: 8 Complexity: 50 Confidence: 66 Actionability: 50

Issue body

### Bug Description Snapcraft fails to fetch packages from remote repositories with architectures different than the hosts, giving error: ``` Stage package not found in part 'foo': ros-jazzy-ros-base:arm64. ``` This is despite `ros-jazzy-ros-base:arm64` being present in a known repo. When running natively on either ARM64 or AMD64 (without `platform` key in yaml), all dependencies are pulled as expected and the build succeeds. ### To Reproduce Simply run snapcraft on the `snapcraft.yaml` file. ### Environment Ubuntu 24.04.2 LTS snapcraft 8.7.4.post91 (tracking latest/edge) LXD rev 33110 (5.21/stable) ### snapcraft.yaml ```yaml name: foo version: '0.0.0' summary: foo description: foo grade: devel confinement: devmode base: core24 lint: ignore: - library - classic platforms: arm64: build-on: [amd64] build-for: [arm64] package-repositories: - type: apt architectures: [$CRAFT_ARCH_BUILD_FOR] formats: [deb, deb-src] components: [main, universe] suites: [noble, noble-updates, noble-backports] key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C url: http://ports.ubuntu.com/ubuntu-ports - type: apt architectures: [$CRAFT_ARCH_BUILD_FOR] formats: [deb, deb-src] components: [main] suites: [noble] key-id: C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 url: http://repo.ros2.org/ubuntu/main parts: foo: plugin: nil source: . stage-packages: - libc6:$CRAFT_ARCH_BUILD_FOR - ros-jazzy-ros-base:$CRAFT_ARCH_BUILD_FOR ``` ### Relevant log output ```shell :: 2025-04-16 08:43:37.275 Pulling foo :: 2025-04-16 08:43:37.276 execute action foo:Action(part_name='foo', step=Step.PULL, action_type=ActionType.RUN, reason=None, project_vars=None, properties=ActionProperties(changed_files=None, changed_dirs=None)) :: 2025-04-16 08:43:37.276 Fetching stage-packages :: 2025-04-16 08:43:37.276 Requested stage-packages: ['libc6:arm64', 'ros-jazzy-ros-base:arm64'] :: 2025-04-16 08:43:39.079 Marking libc6:arm64 (and its dependencies) to be fetched :: 2025-04-16 08:43:39.079 package: libc6:arm64 :: 2025-04-16 08:43:39.201 Marking ros-jazzy-ros-base:arm64 (and its dependencies) to be fetched :: 2025-04-16 08:43:39.201 package: ros-jazzy-ros-base:arm64 :: 2025-04-16 08:43:39.347 Stage package not found in part 'foo': ros-jazzy-ros-base:arm64. :: 2025-04-16 08:43:39.350 Traceback (most recent call last): :: 2025-04-16 08:43:39.350 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 949, in _fetch_stage_packages :: 2025-04-16 08:43:39.350 fetched_packages = packages.Repository.fetch_stage_packages( :: 2025-04-16 08:43:39.350 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: 2025-04-16 08:43:39.350 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/packages/deb.py", line 638, in fetch_stage_packages :: 2025-04-16 08:43:39.350 return cls._fetch_stage_debs( # type: ignore[no-any-return] :: 2025-04-16 08:43:39.350 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: 2025-04-16 08:43:39.350 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/packages/deb.py", line 293, in wrapped :: 2025-04-16 08:43:39.350 return method(*args, **kwargs) :: 2025-04-16 08:43:39.350 ^^^^^^^^^^^^^^^^^^^^^^^ :: 2025-04-16 08:43:39.350 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/packages/deb.py", line 685, in _fetch_stage_debs :: 2025-04-16 08:43:39.350 apt_cache.mark_packages(set(package_names)) :: 2025-04-16 08:43:39.350 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/packages/apt_cache.py", line 328, in mark_packages :: 2025-04-16 08:43:39.350 _verify_marked_install(package) :: 2025-04-16 08:43:39.350 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/packages/apt_cache.py", line 375, in _verify_marked_install :: 2025-04-16 08:43:39.350 raise errors.PackageNotFound(package.name) :: 2025-04-16 08:43:39.350 craft_parts.packages.errors.PackageNotFound: Package not found: ros-jazzy-ros-base:arm64. :: 2025-04-16 08:43:39.351 :: 2025-04-16 08:43:39.351 The above exception was the direct cause of the following exception: :: 2025-04-16 08:43:39.351 Traceback (most recent call last): :: 2025-04-16 08:43:39.351 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_application/services/lifecycle.py", line 302, in run :: 2025-04-16 08:43:39.351 aex.execute(action, stdout=stream, stderr=stream) :: 2025-04-16 08:43:39.351 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 324, in execute :: 2025-04-16 08:43:39.351 self._executor.execute(actions, stdout=stdout, stderr=stderr) :: 2025-04-16 08:43:39.351 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 136, in execute :: 2025-04-16 08:43:39.351 self._run_action(act, stdout=stdout, stderr=stderr) :: 2025-04-16 08:43:39.351 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 211, in _run_action :: 2025-04-16 08:43:39.351 handler.run_action(action, stdout=stdout, stderr=stderr) :: 2025-04-16 08:43:39.351 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 202, in run_action :: 2025-04-16 08:43:39.351 state = handler(step_info, stdout=stdout, stderr=stderr) :: 2025-04-16 08:43:39.351 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: 2025-04-16 08:43:39.351 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 224, in _run_pull :: 2025-04-16 08:43:39.351 fetched_packages = self._fetch_stage_packages(step_info=step_info) :: 2025-04-16 08:43:39.351 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: 2025-04-16 08:43:39.351 File "/snap/snapcraft/14286/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 957, in _fetch_stage_packages :: 2025-04-16 08:43:39.351 raise errors.StagePackageNotFound( :: 2025-04-16 08:43:39.351 craft_parts.errors.StagePackageNotFound: Stage package not found in part 'foo': ros-jazzy-ros-base:arm64. ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 30
Quick Win: 8
Complexity: 50
Confidence: 66
Actionability: 50
keep open Cross-arch stage-packages fetch fails for ros-jazzy-ros-base:arm64. Maintainer and reporter traced it to ROS 2 repo deps marked Architecture: All, i.e. likely upstream, not snapcraft. Triaged as a question (SNAPCRAFT-1026) with no resolution since Apr 2025.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 20
Complexity: 65
Confidence: 75
Actionability: 80
keep open Snapcraft fails to fetch cross-architecture stage-packages when dependencies include architecture-independent packages (:all). Maintainer identified root cause; issue is under investigation.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 12
Staleness: 55
Complexity: 70
Confidence: 55
Support Request: 30
keep open Cross-compile (amd64 build-on, arm64 build-for) fails to fetch stage-packages with :arm64 suffix (e.g. ros-jazzy-ros-base) even though present in repo; maintainer reproduced apt unmet-deps on arch-All python deps; reporter suspects ROS2 repo, not snapcraft. Awaiting reporter's working dpkg repro.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 65
Confidence: 85
Support Request: 40
close stale Snapcraft fails to fetch arm64 stage packages during amd64 builds. Maintainer requested a reproducible environment; reporter could not provide one and suspects upstream ROS2 repo. Inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 60
Confidence: 75
Support Request: 20
close stale Snapcraft fails to fetch cross-architecture stage packages due to dependency resolution issues. Maintainer requested a reproducible environment, but the reporter could not provide one and suspects an upstream ROS2 repository problem. Issue has been inactive for over a year.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft (launchpad)#1827067 (confidence 72%)

    Launchpad bug 'need a way to add foreign architecture to sources.list for build-packages/stage-packages' covers the same unresolved foreign-architecture package fetching problem, with a 2023 core22 reproducer still open.

  • Related To: craft-parts#258 (confidence 65%)

    Merged craft-parts change that made stage-packages fetch from the host architecture's repo; the relevant fetching logic (apt_cache._populate_stage_cache_dir, which only sets APT::Architecture and never adds the target arch as a foreign architecture) still lives in craft-parts, not this repo.

Related issues

No related issues found above the similarity threshold.