"snapcraft cleanbuild --target-arch=i386" produces amd64 executables
Metadata
Current evaluation
Resolved with base-based builds; maintainer Sergiusens noted in 2021 that the legacy LXD cleanbuild architecture issue no longer applied.
Resolution: closed resolved
Reason: The closing maintainer comment states, “This has been solved when using bases.” Base-based builds provided the working architecture path for this scenario.
Evaluated by: mr-cal-bot
No scores available.
Issue body
I wanted to locally build an i386 version of one of my snaps, so "snapcraft cleanbuild" seemed like a good option.
The snap used the autotools part plugin (that claims to support cross compilation) and used a simple automake project, but the resulting snap containd amd64 binaries.
Looking at the output, I can see a number of problems:
1. the container used to build the package appears to be an amd64 one, and the snapcraft installed the amd64 versions of packages I listed in "build-packages".
2. When configure is invoked, it doesn't find the cross compiler, so falls back to the amd64 compiler:
./configure --prefix= --host=i386-linux-gnu
checking for i386-linux-gnu-gcc... no
checking for gcc... gcc
The end result is a supposedly successful build containing binaries with the wrong architecture.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Resolved with base-based builds; maintainer Sergiusens noted in 2021 that the legacy LXD cleanbuild architecture issue no longer applied. | |
| stealth/space-bunny-alpha | — | closed resolved | Resolved by architecture-aware bases; maintainer Sergiusens closed the report in 2021, stating that using bases solved the build problem. | |
| stealth/space-bunny-alpha | — | closed resolved | The i386 build issue was resolved with architecture-aware bases; maintainer Sergiusens closed the report in 2021 stating that using bases solves it. | |
| stealth/space-bunny-alpha | — | closed stale | The i386 cleanbuild report was closed without a documented fix; no resolving PR or commit was identified for the missing cross-compiler and incorrect package architecture. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. snapcraft cleanbuild --target-arch=i386 incorrectly produced amd64 binaries due to an amd64 container, wrong build packages, and a missing cross-compiler. The issue was abandoned. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. Cross-compilation for i386 via snapcraft cleanbuild continued producing amd64 binaries due to an incorrect container architecture and missing cross-compiler configuration. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution or comments, indicating abandonment. The reported cross-compilation bug for i386 targets remains unresolved. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | The cross-compilation bug where snapcraft cleanbuild --target-arch=i386 produces amd64 binaries was closed without resolution. Zero comments and no patches indicate it remains unfixed. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1788654 snapcraft cleanbuild doesn't work with cross-compile stage-packages | snapcraft (launchpad) | closed | Closed as an obsolete legacy cleanbuild/LXD issue after a maintainer directed users to migrate to bases; no targeted cross-architecture fix was recorded. | |
| #1589747 test_cleanbuild unit test fails when executed in a platform that's not amd64 | snapcraft (launchpad) | closed | Fixed by PR ubuntu-core/snapcraft#552 (commit 65c1fac22), making test_cleanbuild architecture-aware; released in snapcraft 2.11 and verified in xenial -updates. | |
| #1796980 Remove cleanbuild | snapcraft (launchpad) | closed | Merged snapcore/snapcraft#2335 as 27ec9ba63, removing LXD lifecycle builds for base-based snaps and making cleanbuild redundant for them. | |
| #1817288 snapcraft cleanbuild produces incorrect architecture snap | snapcraft (launchpad) | closed | Bug (legacy cleanbuild naming a snap _multi.snap despite correct advanced architectures) was never fixed; closed in Aug 2023 by ~sergiusens noting cleanbuild is no longer supported and all builds are now transparently clean. | |
| #1689712 snapcraft cleanbuild fails in xenial with the lxd deb: KeyError: 'kernel_architecture' | snapcraft (launchpad) | closed | Fixed Xenial cleanbuild compatibility with older LXD metadata in snapcore/snapcraft PR #1305, merged as commit 8f15f697f. |