lxd: always (re-)injects snaps
Metadata
Current evaluation
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.
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`?
-----
Fixes: [LP: #1741752](https://bugs.launchpad.net/snapcraft/+bug/1741752)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged to always re-inject snaps into existing LXD containers, fixing Launchpad bug 1741752. The update refactors inject_snap to use SHA384sum comparisons and handles file movements for side-loaded snaps. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged to fix LP: #1741752. Ensures LXD containers always reinject snaps by refactoring injection logic to use sha384sums for comparison and handling file movements for side-loaded snaps. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #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. | |
| #2222 lxd: support new style snap injection | snapcraft | merged | Merged after implementing new style snap injection for LXD. Refactored provider logic, normalized code, and removed test duplication. Approved by two reviewers, passed CI, and verified via edge channel testing. | |
| #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. | |
| #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. | |
| #1577 lxd: don't inject local snaps on a different arch | snapcraft | merged | 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. | |
| #2621 build providers: support injection for LXD | snapcraft | merged | Merged after approval and passing CI. Implements LXD injection support via snapd's new file API, removes legacy mounts, and refactors code for better separation of concerns across 12 files. | |
| #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. | |
| #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. | |
| #3957 tests: retry installing lxd snap | snapcraft | merged | Merged into main. Introduces retry logic for LXD snap installation in tests via snapd-testing-tools to workaround an intermittent snapd bug. Approved, passed CI, and caused no coverage changes. |