snapcraft download debian package from incorrect arch
Metadata
Current evaluation
Cross-architecture gadget snap downloads wrong arch deb (amd64 instead of arm64). Issue is 1249 days old with no maintainer engagement, labels, or assignee.
Suggested action: needs triage
Reason: The issue has no labels, no maintainer response, and no assignee after 1249 days. While it describes a legitimate bug with clear reproduction steps and the reporter has offered to help with a fix, it requires maintainer assessment to prioritize and categorize properly.
Impact:
70
Quick Win:
35.0
Staleness:
85
Complexity:
50
Confidence:
70
Support Request:
15
Issue body
Hi,
I am using snapcraft 7.3.1 revision 8931 to build a gadget snap on a focal vagrant environment, and here is the snapcraft.yaml
"""
name: test-gadget
base: core22
version: 22-0.1
summary: test
description: |
test only
type: gadget
architectures:
- build-on: amd64
build-for: arm64
confinement: strict
grade: stable
package-repositories:
- type: apt
architectures: [ arm64 ]
components: [ main ]
suites: [ jammy, jammy-security, jammy-updates, jammy-backports ]
key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C
url: http://ports.ubuntu.com/ubuntu-ports
parts:
prepare-device-deps:
plugin: nil
stage-packages:
- bsdmainutils:arm64
stage:
- usr/bin/hexdump
"""
After the snap is built successfully, it turns out that the bsdmainutils downloaded is actually from amd64 instead of arm64.
I have done some investigation and come up with two potential solution
1. the python-apt somehow return a amd64 package name in "get_providing_packages()" in "python-apt/apt/cache.py", so maybe we can try to check the arch before return the list. However, the "mark_packages()" in "craft_parts/packages/apt_cache.py" will also need to check the length of returned list first instead of accessing the first element directly
2. maybe check the arch in the "mark_packages()" in "craft_parts/packages/apt_cache.py"
Please let me know if you need any further info from me, any suggestions for how to fix is very welcome, and I am happy to try to provide fix with PR as well if there is a plan on how to fix
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 |
Impact:
70
Quick Win:
35.0
Staleness:
85
Complexity:
50
Confidence:
70
Support Request:
15
|
needs triage | Cross-architecture gadget snap downloads wrong arch deb (amd64 instead of arm64). Issue is 1249 days old with no maintainer engagement, labels, or assignee. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
40
Confidence:
85
Support Request:
10
|
close stale | Bug report on incorrect architecture package downloads during snapcraft builds, including reproduction steps and potential fixes. Unaddressed for over 3 years with zero maintainer interaction. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
65
Confidence:
90
Support Request:
10
|
needs triage | Bug where snapcraft downloads amd64 packages instead of specified arm64 architecture when building gadget snaps. Untriaged, no maintainer response, inactive for over 3 years. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
60
Confidence:
90
Support Request:
10
|
close stale | Bug where snapcraft downloads amd64 packages instead of arm64 when cross-compiling gadget snaps. Unlabelled, no maintainer response, inactive for over 3 years. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
65
Confidence:
75
Support Request:
10
|
needs triage | Snapcraft downloads amd64 packages instead of arm64 when cross-compiling gadget snaps. Unlabeled, no maintainer response, inactive for ~3 years. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #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. | |
| #1980536 snapcraft unusable on systems not using apt | snapcraft (launchpad) | closed | Closed without resolution. Snapcraft retained hard apt dependencies, causing crashes on non-Debian systems like Arch Linux. The issue appears abandoned with no fix provided. | |
| #1817288 snapcraft cleanbuild produces incorrect architecture snap | snapcraft (launchpad) | closed | Abandoned and closed without resolution. The legacy mode cleanbuild multi-arch naming bug remains unfixed due to lack of activity and deprecation of legacy mode. | |
| #1641123 snapcraft does not properly detect the architecture when kernel is 64 bits but userspace is 32 | snapcraft (launchpad) | closed | Closed without resolution. Snapcraft incorrectly identified arm64 architecture in 64-bit kernel/32-bit userspace chroots, generating mismatched snaps. The report was abandoned due to inactivity. | |
| #1921418 wrong architecture of stage-snaps when cross building | snapcraft (launchpad) | open | Cross-building with stage-snaps downloads the wrong architecture snap (tested on snapcraft 4.6). No comments, no activity for ~5 years, tracked under Jira label craft-415. | |
| #2018609 Can't update repositories when building for different arch from host | snapcraft (launchpad) | closed | Cross-architecture repository update bug in snapcraft was closed without discussion or a fix. The report appears abandoned, with no resolution or pull request provided. | |
| #2099923 Snapcraft builds are failing: install of snap "snapcraft" failed | snapcraft (launchpad) | open | Snapcraft builds failing due to outdated snapd (2.61) on build infrastructure unable to install core20 base. Issue is 556 days old with no maintainer response. | |
| #1698888 Snapcraft dpkg-query error on multiarch OS | snapcraft (launchpad) | open | Snapcraft fails on multiarch OS with both i686 and x86_64 libc6 installed, as dpkg -L libc6 returns an ambiguous package name error. 9-year-old issue with no maintainer interaction; the dpkg -L call still exists in craft-parts. | |
| #1560481 snapcraft prints 'architectures' when trying to build a gadget snap | snapcraft (launchpad) | closed | Closed without resolution. The report noted snapcraft printing 'architectures' during gadget snap builds but received no comments or follow-up. |