lxd: don't inject local snaps on a different arch
Metadata
Current evaluation
Merged a fix preventing Snapcraft from injecting local snaps into LXD containers with mismatched architectures. Cross-arch remotes now install snaps from the store. Approved by reviewers and merged after CI checks.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh unit`?
-----
As [brought up in the forum](https://forum.snapcraft.io/t/cleanbuild-remote-on-pi-grabs-wrong-arch-lxc-image/691/15) when running the Snapcraft snap with a remote that has a different architecture it will try to push local snaps that can't be installed. For instance, local x86-64 machine, remote Raspberry Pi, which is armhf. In that case we have to install the snaps from the store instead.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged a fix preventing Snapcraft from injecting local snaps into LXD containers with mismatched architectures. Cross-arch remotes now install snaps from the store. Approved by reviewers and merged after CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix preventing Snapcraft from injecting local snaps into LXD containers with mismatched architectures. Snaps are now fetched from the store instead of failing on remote ARM devices. Fixed a urllib3 test failure. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix preventing local snap injection during LXD remote builds when architectures differ. The change detects mismatches and falls back to installing snaps from the store. Resolved test failures and successfully merged. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1364 lxd: Inject snapcraft and core snaps into the container | snapcraft | merged | Merged. Injects the host's snapcraft and core snaps into LXD containers to ensure build version consistency. Approved by one reviewer, modifying nine files with 360 additions and 46 deletions. | |
| #1865 lxd: always (re-)injects snaps | snapcraft | merged | Merged to fix LP: #1741752 by ensuring LXD containers always re-inject snaps. Changes refactor injection logic, reorganize files, and properly handle side-loaded snap assertions. Approved by reviewer and passed CI. | |
| #1718 lxd: let lxd choose the architecture | snapcraft | merged | Merged after two approvals and passing CI. Removes snapcraft's redundant LXD architecture selection logic, delegating it to LXD. Architecture recording now occurs post-container startup. Released with version 2.35. | |
| #1263 lxd: pass through commands into the container | snapcraft | merged | Merged a pull request enabling snapcraft to pass build commands into LXD containers. The change allows remote builds to execute within the container environment, addressing path mounting issues during remote snap creation. Approved by one reviewer, though coverage decreased slightly. | |
| #1739 lxd: refresh remote container | snapcraft | merged | Fixes snapcraft refresh to correctly target the remote LXD container specified in SNAPCRAFT_CONTAINER_BUILDS instead of defaulting to local. Merged after approval and successful testing. | |
| #1568 lxd: don't re-inject the same snaps | snapcraft | merged | Merged a fix for an LXD bug that repeatedly re-injected identical snaps due to mismatched revision filenames. The change resolves the issue by comparing snap hashes instead of relying on filename matching, preventing unnecessary reinstallations. | |
| #2098 lxd: wait for on-going refreshes to finish | snapcraft | merged | Merged fix adding a snap watch call before injecting snaps into LXD containers to wait for ongoing refreshes. Resolves race conditions causing build failures in issues #2037 and LP: #1722049. Approved by reviewer and passed CI. | |
| #1412 lxd: snapcraft refresh in containers | snapcraft | merged | Merged after awaiting prerequisite PR #1627. Implements snapcraft refresh for LXD containers, updating apt cache and packages once to persist changes across builds. Resolves container update persistence issues following successful testing. | |
| #1984 fix(snap): check if LXD is actually installed | charmcraft | merged | Merged fix updating configure and remove hooks to verify LXD installation before proceeding. Prevents unwanted LXD snap installations on Ubuntu that cause delays. Approved by two reviewers, passed CI, and resolves #1982. | |
| #2046 lxd: specify arch in lxc image list command | snapcraft | merged | Merged fix for LXD image listing regression. Explicitly specifies architecture in the lxc image list command to ensure correct SNAPCRAFT_IMAGE_INFO values in the manifest. Resolves LP: #1760857. Tests updated. |