Snapcraft pulling wrong arch of debs when building foreign snaps
Metadata
Current evaluation
Reported --target-arch pulling wrong debs for foreign arch builds. Maintainers noted the feature was broken and disabled for core20. Marked resolved as cross-builds have been significantly improved in recent Snapcraft versions.
Resolution: closed resolved
Reason: Maintainer marked the issue as resolved, noting that cross-builds have been significantly improved in Snapcraft, addressing the original --target-arch limitations.
Evaluated by: mr-cal-bot
No scores available.
Issue body
snapcraft --destructive-mode --target-arch=armhf to build a foreign cpu arch snaps on a x86 machine.
debs specified in stage-packages is not reflecting to the --target-arch=CPU_ARCH when building a snap.
---
Step to reproduce: ( with the attached snapcraft.yaml )
run "snapcraft --destructive-mode --target-arch=armhf"
Expected result:
$> file $SNAP/usr/bin/hello
usr/bin/hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=cb9b55fcb9c1b16033fbd3724d0fac693dd346d1, stripped
Actual result:
$> file $SNAP/usr/bin/hello
squashfs-root/usr/bin/hello: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=4fdca4285732fa8a76721f495e5c5e5295ec237b, for GNU/Linux 3.2.0, stripped
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | closed resolved | Reported --target-arch pulling wrong debs for foreign arch builds. Maintainers noted the feature was broken and disabled for core20. Marked resolved as cross-builds have been significantly improved in recent Snapcraft versions. | |
| stealth/space-bunny-alpha |
Impact:
55
Quick Win:
10
Complexity:
70
Confidence:
84
Actionability:
60
|
close stale | A reproducible foreign-build defect was confirmed, but target-arch was disabled for core20 as unsupported. Modern Snapcraft uses build-on/build-for platform builds; no resolving fix is established. | |
| stealth/space-bunny-alpha |
Impact:
55
Quick Win:
26
Complexity:
43
Confidence:
88
Actionability:
84
|
close resolved | Legacy --target-arch builds staged host-architecture DEBs; a later fix selects packages by target architecture, and current cross-compilation uses platforms build-on/build-for settings. | |
| stealth/space-bunny-alpha |
Impact:
40
Quick Win:
29
Complexity:
15
Confidence:
94
Actionability:
86
|
close not a bug | Legacy --target-arch=armhf builds on x86 staged x86-64 DEBs; modern cross-builds must qualify stage packages with :$CRAFT_ARCH_BUILD_FOR, so this behavior is expected. | |
| qwen/qwen3.8-27b |
Impact:
20
Quick Win:
11
Staleness:
95
Complexity:
45
Confidence:
72
Support Request:
30
|
close stale | 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. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
45
Confidence:
90
Support Request:
10
|
close stale | Snapcraft incorrectly pulls x86-64 debs instead of armhf when using --target-arch on x86 machines. The issue has been inactive for over six years with no maintainer response or comments. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
45
Confidence:
85
Support Request:
15
|
close stale | Snapcraft incorrectly pulls x86-64 DEBs instead of armhf when using --target-arch for cross-architecture builds. Unaddressed for over six years with no maintainer interaction or labels. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
65
Confidence:
75
Support Request:
15
|
close stale | Snapcraft pulls x86-64 debs instead of the target architecture during foreign builds. The report is over six years old with zero maintainer interaction or updates. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1943603 snapcraft --target-arch=i386 does not build i386 images, because core20 does not support i386 and yet the build starts and wastes time | snapcraft (launchpad) | open | Legacy Snapcraft accepted an unsupported core20/i386 target, wasted build time, and produced an amd64 snap; current validation excludes i386 and drops core20. | |
| #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 | Core22 cross-compilation can treat an architecture-independent dependency as target-specific; cross-architecture behavior was reproduced, but current core24 behavior remains unverified. | |
| #1999580 core22: wrong arch in snap.yaml when building for all archs | snapcraft (launchpad) | closed | Fixed in merged canonical/snapcraft#4150 (commit 77d3454d): core22 snap.yaml now records build-for (all) instead of the build-on architecture. | |
| #2015091 snapcraft download debian package from incorrect arch | snapcraft (launchpad) | open | Cross-building for arm64 on amd64 resolved explicitly qualified bsdmainutils:arm64 to an amd64 package; the valid report remains untriaged and a similar bug is still open. | |
| #1862256 snapcraft should complain loudly when building base: core20 snap on i386 | snapcraft (launchpad) | closed | Closed as superseded: improved architecture parsing rejects unsupported core20/i386 builds, making a dedicated check unnecessary; snapcraft#4392 improved this handling. | |
| #1641123 snapcraft does not properly detect the architecture when kernel is 64 bits but userspace is 32 | snapcraft (launchpad) | closed | Fixed in snapcore/snapcraft#1089 by deriving the build architecture from the compiler target, preventing 32-bit ARM artifacts from being mislabeled arm64. | |
| #2099923 Snapcraft builds are failing: install of snap "snapcraft" failed | snapcraft (launchpad) | open | Reported Launchpad Bionic non-i386 builds cannot install Snapcraft 7.x/stable because core20 needs snapd 2.61; the issue remains open, untriaged, and unanswered. | |
| #2012074 snapcraft cannot build snap by default on aarch64 | snapcraft (launchpad) | open | ARM64 default builds failed on Snapcraft 7.3.1 because core20 selected amd64-only Multipass images; later defaults use core22/LXD on Linux, addressing the reported path. | |
| #1997752 base core20: wrong arch triplet | snapcraft (launchpad) | closed | Wrong SNAPCRAFT_ARCH_TRIPLET for core20 build-on/run-on builds fixed by adding SNAPCRAFT_ARCH_BUILD_ON/BUILD_FOR and *_TRIPLET_BUILD_FOR envvars (PR #4313, commit 93a9d8170); follow-up #4332 (48bd0632f) errors on unevaluable multi-arch cases. |