← Back to issue list

No way to natively build for the non-host arch

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1835556
Type
issue
State
open
Author
~laney
Labels
Created
Updated
Closed

Current evaluation

2018 feature request for snapcraft to build for non-host architectures (e.g. --arch=i386) by launching a matching VM/container. Zero comments, no labels, dormant 7+ years; modern snapcraft now supports cross-arch builds via --build-for, so the request is effectively fulfilled.

Suggested action: close stale

Reason: The issue has had zero comments, no labels, and no maintainer interaction for 2614 days (~7 years), and the capability it requests is now available: modern snapcraft supports building for non-host architectures via --build-for (corroborated by related issues referencing snapcraft 7.5/8.5/9.1 cross-arch behavior, e.g. #4627 fixed in 9.1). The original bionic-era --use-lxd/minimal-image constraints no longer apply. Confidence is moderate because repo tooling was unavailable to directly confirm the --build-for flag in current source.

Impact: 25 Quick Win: 10.0 Staleness: 95 Complexity: 60 Confidence: 65 Support Request: 10

Issue body

installed: 3.6 (3059) 59MB classic Just now I was trying to reproduce a snap build failure that happened on i386 but not amd64. This computer can natively run i386 code, VMs and containers, so I was hoping that snapcraft would let me do a native build. It couldn't :(. I just filed a multipass bug (https://github.com/CanonicalLtd/multipass/issues/886) requesting `multipass launch bionic/i386` support, à la LXD. Basically I'm asking for snapcraft to support the same, i.e. the ability to do: $ snapcraft --arch=i386 and it'd launch an i386 VM or container. I noticed also that `--use-lxd` hits cloud-images.ubuntu.com directly to get a minimal image, and only amd64 images are published there (see https://cloud-images.ubuntu.com/minimal/releases/bionic/release/). That means it's not possible to extend this method to support multiple arches, i.e. `snapcraft --arch=i386 --use-lxd` wouldn't work. The non-minimal images (https://cloud-images.ubuntu.com/releases/18.04/release/) have more arches. So I suppose to fix LXD properly we'd have to either switch to non-minimal images or convince the team to produce minimal for more arches.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 25
Quick Win: 10.0
Staleness: 95
Complexity: 60
Confidence: 65
Support Request: 10
close stale 2018 feature request for snapcraft to build for non-host architectures (e.g. --arch=i386) by launching a matching VM/container. Zero comments, no labels, dormant 7+ years; modern snapcraft now supports cross-arch builds via --build-for, so the request is effectively fulfilled.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 50
Confidence: 85
Support Request: 10
close stale Feature request to add native cross-architecture build support to snapcraft via a --arch flag. The issue has been completely inactive for ~7 years with no maintainer response, labels, or assignee.
qwen/qwen3.6-35b-a3b
Staleness: 100
Complexity: 60
Confidence: 90
Support Request: 10
close stale Feature request to add native cross-architecture build support via a --arch flag. Unlabelled, zero comments, and inactive for over seven years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 80
Confidence: 90
Support Request: 10
close stale Feature request to enable native cross-architecture builds in snapcraft via multipass/LXD. Issue is seven years old with no maintainer response or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 55
Confidence: 70
Support Request: 10
close stale Feature request to add native cross-architecture build support to snapcraft. Unlabelled, zero maintainer interaction, and inactive for over seven years.

Update history

No update history recorded yet.

Related work

  • Blocked By: CanonicalLtd/multipass#886 (confidence 80%)

    Explicitly referenced in the issue body: the request depended on multipass gaining non-amd64 image launch support.

  • Related To: snapcraft#4627 (confidence 60%)

    Same problem area (building for a non-host arch); shows modern snapcraft handles cross-arch container builds, fixed in 9.1 via PR #6394.

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 Reports that snapcraft --target-arch=i386 on a core20 base silently builds an amd64 snap instead of failing early, wasting build time. Unlabelled, 0 comments, inactive ~5 years; a related core20/i386 bug was closed as superseded by improved arch parsing.
72%
#1660302 foreign architecture builds doesn't work with classic snaps snapcraft (launchpad) open Cross-arch builds (--target-arch) of classic snaps fail because the build environment lacks the core snap. Reported 2016 against snapcraft 2.x; 0 comments, no maintainer response; codebase since fully rewritten.
72%
#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.
72%