← Back to issue list

Snapcraft doesn't check if cross-compiling before trying to install necessary tools

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1570414
Type
issue
State
closed
Author
~kyrofa
Labels
—
Created
Updated
Closed

Current evaluation

Fixed: cross-build packages are now only installed when actually cross-compiling. Resolved by merged PR canonical/snapcraft#451 (commit 96b811df1), released in Snapcraft 2.8.1 via #465; LP bug closed.

Resolution: closed resolved

Reason: Merged PR #451 (commit 96b811df1) changed Snapcraft to only add cross-compiler build packages when cross-compiling, preventing failures like the missing 'gcc-arm-linux-gnueabihf' package on native armhf. The maintainer referenced PR #451 as the fix and shipped it in 2.8.1.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Snapcraft supports cross-compiling (assuming the given plugin also supports it), and attempts to install the correct cross-compiler when doing so. However, it doesn't check to see that it's actually cross-compiling before building those packages, so for instance running on armhf results in: Could not find a required package in 'build-packages': "The cache has no package named 'gcc-arm-linux-gnueabihf'"

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed: cross-build packages are now only installed when actually cross-compiling. Resolved by merged PR canonical/snapcraft#451 (commit 96b811df1), released in Snapcraft 2.8.1 via #465; LP bug closed.
stealth/space-bunny-alpha — closed resolved Fixed: cross-build packages are now only added when cross-compiling. Merged as canonical/snapcraft#451 (commit 96b811df1), resolving LP #1570418/1570414; released in Snapcraft 2.8.1 via #465.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #451 (commit 96b811df1): cross-build tools are now added only when cross-compiling. The fix was released in Snapcraft 2.8.1 via #465.
qwen/qwen3.6-35b-a3b — — Closed without resolution or comments, likely abandoned or superseded. Snapcraft failed to conditionally install cross-compilation tools, triggering armhf build errors.
qwen/qwen3.6-35b-a3b — — Closed without resolution or comments. The issue appears abandoned, leaving the bug where Snapcraft incorrectly attempts to install cross-compiler packages on native architectures unfixed.
qwen/qwen3.6-35b-a3b — — Closed without comments or linked pull requests. The cross-compilation check was not explicitly fixed or documented, indicating the issue was likely abandoned.
qwen3.6-35b-a3b-mtp-q6 — — Closed without documented resolution. The reported bug regarding unconditional cross-compiler package installation on native armhf builds was abandoned.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#451 (confidence 98%)

    Merged PR 'Only add cross build packages when cross compiling.' (commit 96b811df1), cited by the maintainer as the resolution and linked in the closing comment.

Related issues

Issue Project State Summary Similarity
#1983009 Snapcraft 7.1.0 fails to find stage package when cross-compiling snapcraft (launchpad) closed Fixed by canonical/snapcraft#3416 (commit 8f418e3d9), restoring core20 behavior so stage packages come from build-on repositories during cross-compilation.
79%
#1064 fix: skip injecting snaps from host when cross-building craft-application closed Closed as redundant after the same cross-build snap-injection fix merged in canonical/craft-application#1037 via commit 16bd7ac3.
75%
#4996 remote build: fix cross-compiling errors and `build-for: all` errors snapcraft closed Fixed by merged PR canonical/snapcraft#5265 (commit f94da8f13), sending build-on architectures to Launchpad for correct cross-compilation and build-for: all behavior.
72%
#1570835 snapcraft 2.8 fails on s390x snapcraft (launchpad) closed Snapcraft 2.8's missing s390x handling was fixed by ubuntu-core/snapcraft PR #461, merged as commit d3c242fa2.
70%
#1570706 Snapcraft cleanbuild command doesn't work snapcraft (launchpad) closed Fixed by merged canonical/snapcraft PR #458 (f78b1e3a3), which corrected Cleanbuilder constructor arguments so snapcraft cleanbuild could initialize its container.
70%