← 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-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.

Suggested action: keep open

Reason: Maintainer mr-cal actively engaged (reproduced the apt unmet-dependency error, confirmed arch-All python deps, and on 2025-04-21 asked the reporter for a working dpkg repro to determine what snapcraft must replicate). The reporter responded 2025-04-23 that they could not produce such an environment and suspects the ROS2 repo itself. The issue is triaged, acknowledged, and blocked on external info from the reporter, so it should stay open rather than be closed as stale.

Impact: 40 Quick Win: 12.0 Staleness: 55 Complexity: 70 Confidence: 55 Support Request: 30

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
qwen/qwen3.8-27b
Impact: 40
Quick Win: 12.0
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 45
Confidence: 75
Support Request: 30
close stale Cross-architecture stage package fetching fails when architecture-independent dependencies are incorrectly requested with a target arch suffix. Issue is open and stale, awaiting author reproduction or maintainer investigation.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#4268 [cross-compile] when a deb package that has a dependency to non-architecture deb package, snapcraft does not recognize that and throws a dependency error snapcraft open Cross-compiling a core22 snap with an arch-pinned stage package (gpsd-clients:arm64) fails with 'unmet dependencies: python3-serial' because non-arch-specific deps aren't resolved for the target arch. Maintainer offered a workaround and asked if it reproduces on core24; no reply yet.
73%