← Back to issue list

[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

View original Github issue

Metadata

Project
snapcraft
Number
#4268
Type
issue
State
open
Author
bugraaydogar
Labels
Status: Needs information
Created
Updated
Closed

Current evaluation

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.

Suggested action: keep open

Reason: A maintainer (mr-cal) engaged on 2026-01-27, confirmed the workaround (gpsd-tools:$CRAFT_ARCH_BUILD_FOR), noted cross-compiling improvements in Snapcraft 8.8 for core24, and explicitly asked whether the problem still replicates on core24. The reporter has not yet responded, so the issue is awaiting information from the original author rather than being stale or untriaged. The underlying bug (arch-pinned stage packages pinning all dependencies to that arch, and host-arch staging without an explicit suffix) is a real cross-compilation defect, not a support question.

Impact: 50 Quick Win: 15.0 Staleness: 55 Complexity: 70 Confidence: 60 Support Request: 20

Issue body

### Bug Description I experienced a weird error just recently while cross-building a snap based on core22. Basically, when the following dep package is added to the stage-package and `snapcraft --destructive-mode --target-arch=arm64 --enable-experimental-target-arch` is used, it will end up with the following error `Package 'gpsd-clients:arm64' has unmet dependencies: python3-serial`. ``` stage-packages: - gpsd-clients:arm64 ``` However, when I dig further, I realized that it is mainly because the python3-serial package is not architecture specific. If you try to stage-package a different deb package that is architecture specific. There is no error on this. Finally, according to my test results, if you do not specify any architecture, by default amd64 is used and snapcraft makes an exception for amd64 and does not complain about the unmet dependencies. ### To Reproduce 1- Build the following snapcraft.yaml file with `snapcraft --destructive-mode --target-arch=arm64 --enable-experimental-target-arch`. You will end up with `Package 'gpsd-clients:arm64' has unmet dependencies: python3-serial` ``` name: my-snap # you probably want to 'snapcraft register <name>' base: core22 # the base snap is the execution environment for this snap version: '0.1' # just for humans, typically '1.2+git' or '1.3.2' summary: snap for running gpsd multiplexer # 79 char long summary description: | A snap for running GPSD, such that gps data from gpsd supported devices can be multiplexed and served over internal netwok of an ubuntu core machine. grade: devel # must be 'stable' to release into candidate/stable channels confinement: devmode # use 'strict' once you have the right plugs and slots architectures: - build-on: [amd64] build-for: [arm64] parts: gpsd: plugin: nil stage-packages: - gpsd-clients:arm64 ``` Then, build the following snapcraft.yaml file which is using a package that has architecture specific dependencies. ``` name: my-snap # you probably want to 'snapcraft register <name>' base: core22 # the base snap is the execution environment for this snap version: '0.1' # just for humans, typically '1.2+git' or '1.3.2' summary: snap for running gpsd multiplexer # 79 char long summary description: | A snap for running GPSD, such that gps data from gpsd supported devices can be multiplexed and served over internal netwok of an ubuntu core machine. grade: devel # must be 'stable' to release into candidate/stable channels confinement: devmode # use 'strict' once you have the right plugs and slots architectures: - build-on: [amd64] build-for: [arm64] parts: gpsd: plugin: nil stage-packages: - gpsd-tools:arm64 ``` You will realize that, it builds without any issues. ### Environment Ubuntu 22.04 LTS. ### snapcraft.yaml ```shell Already provided. ``` ### Relevant log output ```shell ubuntu@snapcraft-jammy:~/host/work/geoint/issue$ snapcraft pull --destructive-mode --target-arch=arm64 --enable-experimental-target-arch --verbose Starting Snapcraft 7.4.3 Logging execution to '/home/ubuntu/.local/state/snapcraft/log/snapcraft-20230711-131542.525797.log' Running on amd64 for arm64 Initializing parts lifecycle Executing parts lifecycle... Executing parts lifecycle: pull gpsd Executing action Package 'gpsd-clients:arm64' has unmet dependencies: python3-serial. Full execution log: '/home/ubuntu/.local/state/snapcraft/log/snapcraft-20230711-131542.525797.log' ``` ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 50
Quick Win: 15.0
Staleness: 55
Complexity: 70
Confidence: 60
Support Request: 20
keep 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.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 40
Confidence: 75
Support Request: 30
close stale Cross-compilation dependency resolution fails for non-arch-specific packages in Snapcraft. Issue is old, has a workaround, and may be resolved in newer versions.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 70
Confidence: 85
Support Request: 20
keep open Cross-compiling snaps with architecture-specific packages fails due to unmet dependencies on non-arch packages. Labeled needs information; awaiting author's test results on core24/Snapcraft 8+.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 60
Confidence: 80
Support Request: 20
close stale Cross-compilation fails when architecture-specific deb packages depend on all-arch packages, triggering unmet dependency errors. Status: Needs information to verify if recent core24 cross-compilation improvements resolve the issue.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft/snapcraft#3416 (confidence 70%)

    Commit 'repo: default to target arch for stage package cache' directly addresses stage-package arch selection during cross-compilation, the same area as this bug.

  • Related To: snapcraft/snapcraft#3418 (confidence 65%)

    Commit 'project: always set target arch even if not cross compiling' is part of the same target-arch handling work referenced by the maintainer's cross-compiling improvements.

  • Related To: snapcraft/snapcraft#3461 (confidence 60%)

    Commit 'repo: account for arch & version when filtering stage packages' touches arch-aware stage-package filtering relevant to this dependency-resolution failure.

Related issues

Issue Project State Summary Similarity
#5411 Fail to fetch packages for non-host architecture snapcraft 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.
73%
#1881515 Snapcraft pulling wrong arch of debs when building foreign snaps snapcraft (launchpad) open 2018 report: --target-arch=armhf on x86 pulls x86-64 stage-packages debs instead of armhf. No labels, comments, or maintainer response in 6+ years. Legacy --target-arch flag removed; modern cross-compile documents the :$CRAFT_ARCH_BUILD_FOR suffix requirement.
71%