← Back to issue list

remote build: fix cross-compiling errors and `build-for: all` errors

View original Github issue

Metadata

Project
snapcraft
Number
#4996
Type
issue
State
closed
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Fixed by merged PR canonical/snapcraft#5265 (commit f94da8f13), sending build-on architectures to Launchpad for correct cross-compilation and build-for: all behavior.

Resolution: closed resolved

Reason: PR canonical/snapcraft#5265 was merged as commit f94da8f13. It now passes build-on architectures to Launchpad instead of build-for architectures.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### What needs to get done Pass the `build-on` architectures to Launchpad rather than the `build-for` architectures. ### Why it needs to get done * To allow for cross-compiling with remote builds rather than failing with an unhelpful error from Launchpad. * To allow `build-for: [all]` to build on the correct architecture rather than `amd64`. Launchpad doesn't support cross-compiling nor does it have a concept of `build-on` vs `build-for` architectures. This is a problem for Snapcraft, because remote-build accepts a `--build-for` argument but has to provide the `build-on` to Launchpad. Thanks to craft-application's build plan filtering, we can easily enable cross-compiles with the following constraints: * Snapcraft only allows one artifact to be remotely built on each build-on architecture (due to #4995). * Launchpad accepts a list of architectures where to build an artifact and choose one architecture from that list.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/snapcraft#5265 (commit f94da8f13), sending build-on architectures to Launchpad for correct cross-compilation and build-for: all behavior.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #5265 (commit f94da8f13): remote builds now send build-on architectures to Launchpad, enabling cross-compilation and correct build-for: all builds.
stealth/space-bunny-alpha — closed resolved Fixed in canonical/snapcraft#5265 (commit f94da8f13): remote builds now send build-on architectures to Launchpad, enabling cross-compilation and correct build-for: all builds.
stealth/space-bunny-alpha — closed resolved Remote builds were fixed in merged PR canonical/snapcraft#5265 (commit f94da8f13) by sending build-on architectures to Launchpad, enabling cross-compilation and correcting build-for: all builds.
qwen/qwen3.6-35b-a3b — — Fixed by passing build-on architectures to Launchpad instead of build-for, enabling cross-compiling and correct architecture selection for build-for: all.
qwen/qwen3.6-35b-a3b — — Closed after fixing the remote build configuration to pass build-on architectures to Launchpad instead of build-for. This resolves cross-compiling failures and ensures build-for: all targets the correct architecture.
qwen/qwen3.6-35b-a3b — — Closed and superseded by internal Jira ticket CRAFT-3280. The issue outlines passing build-on architectures to Launchpad instead of build-for to resolve cross-compiling and build-for: all errors, but no code changes were merged.
qwen3.6-35b-a3b-mtp-q6 — — Closed and deferred to internal Jira ticket CRAFT-3280. The proposed fix to pass build-on architectures to Launchpad instead of build-for was tracked internally without an external merge or implementation.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/snapcraft#5265 (confidence 100%)

    Merged fix that changed remote builds to submit build-on architectures to Launchpad.

Related issues

Issue Project State Summary Similarity
#5265 fix(remotebuild): don't fail when cross-compiling snapcraft merged Merged PR #5265 fixed remote cross-compilation by sending build-on architectures to Launchpad; commit f94da8f13 closed #4996.
76%
#1379 fix: make snap build on all architectures. (#1377) charmcraft closed Merged PR #1379 as commit f5558b8f, fixing Charmcraft snap builds on armhf, arm64, ppc64el, and s390x; all four Launchpad builds passed.
76%
#4314 Raise error when using `BUILD_FOR` envvars on multi-arch and unknown builds snapcraft closed Fixed by PR #4332 (commit 48bd0632f), which makes Snapcraft error when BUILD_FOR architecture variables cannot be evaluated for multi-arch or unknown-architecture builds.
72%
#4780 remote build: fails with some architecture definitions snapcraft closed Remote-build architecture handling was fixed by merged PR canonical/snapcraft#4793 (commit 53ec55cef), with companion support in canonical/craft-application#343.
72%
#1570414 Snapcraft doesn't check if cross-compiling before trying to install necessary tools snapcraft (launchpad) closed 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.
72%
#4858 remote build: platform definitions cannot be parsed by Launchpad snapcraft closed Launchpad parsing was addressed upstream, and merged PR canonical/snapcraft#4994 (5cd480725) fixed remote-build handling of --platform and --build-for.
72%
#1377 fix: make snap build on all architectures. charmcraft merged Merged PR #1377 as f5558b8f, fixing #1369 with successful Charmcraft snap builds on armhf, arm64, ppc64el, and s390x.
70%
#1425 options: properly handle missing compiler prefix snapcraft merged Merged in canonical/snapcraft#1425 via commit 96e60f93a, fixing missing compiler-prefix handling and preventing cross-compiles from failing with an unset machine-target attribute.
70%
#1481 fix: make snap build on all architectures. (#1377) charmcraft merged Merged #1481 cherry-picked #1377’s f5558b8f fix, restoring feature-branch snap builds on armhf, arm64, ppc64el, and s390x.
70%