← Back to issue list

snapcraft cleanbuild doesn't work with cross-compile stage-packages

View original Launchpad issue

Metadata

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

Current evaluation

Closed as an obsolete legacy cleanbuild/LXD issue after a maintainer directed users to migrate to bases; no targeted cross-architecture fix was recorded.

Resolution: closed stale

Reason: The only maintainer response was @sergiusens' 2021-08-06 request to "please migrate to bases." No implementation followed, and the report concerns the legacy cleanbuild/LXD path.

Evaluated by: mr-cal-bot

No scores available.

Issue body

When cross-compiling a snap on (for example) amd64 to run on armhf, I have rules like this in the snapcraft.yaml: stage-packages: - on amd64 to armhf: - "sqlite3:armhf" - else: - "sqlite3" Because when running the snap on an armhf machine, obviously it needs the armhf version and not the amd64 version. Hence the "sqlite:armhf" syntax to specify using the armhf version of the package. However, snapcraft cleanbuild doesn't setup the container in a way that supports this as it fails with: Failed to fetch stage packages: Error downloading packages for part 'gg-sdk-deps': The package 'sqlite3:armhf' was not found. You may need to add support for this architecture with 'dpkg --add-architecture armhf'.. Which obviously I can't do inside the lxd container as it was launched/setup by snapcraft with something like `snapcraft cleanbuild --target-arch=armhf`. So I think the bug here is that specifying `--target-arch=SOME_OTHER_ARCH` and arguably some permutation of the `architectures` key setup inside snapcraft.yaml need to trigger snapcraft to do the necessary things inside the container to setup installing cross-architecture packages, i.e. the dpkg --add-architecture step suggested and also setup /etc/apt/sources.list.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed stale Closed as an obsolete legacy cleanbuild/LXD issue after a maintainer directed users to migrate to bases; no targeted cross-architecture fix was recorded.
stealth/space-bunny-alpha — closed superseded Closed after a maintainer requested migration to bases, superseding the legacy cleanbuild/LXD workflow and its cross-architecture package setup.
stealth/space-bunny-alpha — closed stale Closed with no documented fix, linked pull request, or closing discussion; the foreign-architecture stage-package failure was left without a recorded resolution.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The cross-architecture stage-package setup failure in snapcraft cleanbuild was abandoned. No fix or merge details were provided, likely due to the tool's deprecation and evolving build workflows.
qwen/qwen3.6-35b-a3b — — Closed without resolution. Snapcraft cleanbuild fails during cross-compilation because it does not automatically configure multi-arch package support inside the container. No fix was implemented, and the report appears abandoned.
qwen/qwen3.6-35b-a3b — — snapcraft cleanbuild failed when using cross-compile stage-packages due to missing container architecture setup. The issue was closed without resolution, effectively abandoned.
qwen3.6-35b-a3b-mtp-q6 — — Abandoned due to inactivity. The issue reported that snapcraft cleanbuild fails during cross-compilation because the LXD container lacks multi-arch dpkg setup. No resolution was implemented.

Update history

Date Change
created

Related work

  • Related To: canonical/launchpad/snapcraft#2335 (confidence 72%)

    Commit 27ec9ba63 removed LXD lifecycle support for bases, consistent with retiring the affected workflow, though it was not cited as the direct fix.

Related issues

Issue Project State Summary Similarity
#1666735 snapcraft cleanbuild does not work with lxd installed via snap snapcraft (launchpad) closed Fixed by merged canonical/snapcraft#1199 (commit 417989880), making cleanbuild LXD detection packaging-independent instead of relying on apt package metadata.
79%
#1752498 cleanbuild fails with lxd snap snapcraft (launchpad) closed Closed as obsolete: the cleanbuild command was removed; Snapcraft builds now perform clean builds by default.
77%
#1746612 Snapcraft cleanbuild doesn't work if you're not using the LXD snap snapcraft (launchpad) closed Closed after the missing hostfs behavior was fixed upstream in lxc/lxd#4183. Snapcraft PR #1912 offered a workaround but was not merged.
76%
#1811208 snapcraft failed to build with cleanbuild on 18.04 snapcraft (launchpad) closed Expired after 60 days without activity; no fix was recorded. A maintainer advised using --destructive-mode because cross-compilation in build environments was unsupported.
76%
#1737532 "snapcraft cleanbuild --target-arch=i386" produces amd64 executables snapcraft (launchpad) closed Resolved with base-based builds; maintainer Sergiusens noted in 2021 that the legacy LXD cleanbuild architecture issue no longer applied.
75%
#1822372 Snapcraft cleanbuild on Arch Linux with LXD - AppArmor permission error snapcraft (launchpad) closed LP #1822372 closed as not-a-bug/stale: reporter resolved the AppArmor error with an LXD profile workaround (security.nesting/privileged, raw.lxc cgroup lines); maintainer later closed it noting cleanbuild was removed as builds are clean by default.
74%
#1697979 snapcraft fails on initial cleanbuild probe snapcraft (launchpad) closed Closed as obsolete: cleanbuild was decommissioned, and standard Snapcraft builds now transparently use a clean build environment.
74%
#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.
74%
#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.
74%
#1800119 snapcraft cleanbuild snapcraft (launchpad) closed The obsolete cleanbuild command was retired because builds became clean by default; a maintainer closed the report in August 2023.
73%