lxd: don't re-inject the same snaps
Metadata
Current evaluation
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.
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: [bug 1716923](https://bugs.launchpad.net/snapcraft/+bug/1716923)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged to fix LXD duplicate snap injection. Initial hash checks failed due to arbitrary x-revisions changing filenames. Resolution updated the logic to query the active container snap directly, preventing unnecessary reinstalls. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix for an LXD issue where snaps were repeatedly re-injected due to revision-based filename mismatches. The solution queries the actual snap in use within the container instead of relying on filename-based hash comparison. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #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. | |
| #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. | |
| #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. | |
| #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. | |
| #1912 lxd: unset SNAP to work-around LXD deb thinking it's a snap | snapcraft | closed | Rejected and closed. Maintainers declined the workaround, preferring a proper fix in LXD or a redesigned environment handler. The pull request was abandoned without merging despite ongoing user breakage. | |
| #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. |