← Back to issue list

lxd: support new style snap injection

View original Github issue

Metadata

Project
snapcraft
Number
#2222
Type
pull request
State
merged
Author
sergiusens
Labels
—
Created
Updated
Closed

Current evaluation

Merged in #2222 via commit 8acd203, adding new-style LXD snap handling, removing sudo-based injection, and consolidating duplicated tests.

Resolution: closed resolved

Reason: PR #2222 was merged into master as 8acd203a8696bbf7cd35e586563dd381dd553fa5. Maintainers validated the merged change using the edge/lxd channel.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Use the same logic as the one implemented in the new provider logic. Take the opportunity to normalize and untangle the code and also fix the tests to remove duplication and unnecessary over mocking. Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com> - [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 tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged in #2222 via commit 8acd203, adding new-style LXD snap handling, removing sudo-based injection, and consolidating duplicated tests.
stealth/space-bunny-alpha — closed resolved Merged in #2222: aligned LXD with new provider snap handling, refactored the implementation, and removed duplicated tests. edge/lxd was tested; sudo-based injection was dropped.
qwen/qwen3.6-35b-a3b — — 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.
qwen3.6-35b-a3b-mtp-q6 — — Merged LXD provider updates for new style snap injection. Code was normalized, tests refactored, and injection adjusted for unprivileged containers. Successfully tested and published to the edge channel.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1865 lxd: always (re-)injects snaps snapcraft merged Merged PR #1865 as e99354492, fixing LP #1741752 by ensuring LXD re-injects required snaps when needed.
78%
#1364 lxd: Inject snapcraft and core snaps into the container snapcraft merged Merged PR #1364 as 99f5598ac, injecting the host's Snapcraft and core snaps into LXD containers so builds no longer use a mismatched Xenial archive version.
78%
#2621 build providers: support injection for LXD snapcraft merged Merged as d59622a81, adding LXD snap injection through snapd's file API, replacing mount-based injection with file pushes, and refactoring provider concerns.
78%
#1788667 changes in snapd break lxd snap injection for cleanbuild snapcraft (launchpad) closed snapd's 0600 perms on injected snaps broke LXD cleanbuild injection. Fixed by merged PR snapcore/snapcraft#2222 (commit b2bd6b776), adding new-style LXD snap injection; bug closed.
77%
#1577 lxd: don't inject local snaps on a different arch snapcraft merged Merged in snapcraft#1577 via commit 5cef61310, preventing incompatible local snaps from being injected into cross-architecture LXD builds and using store snaps instead.
75%
#1568 lxd: don't re-inject the same snaps snapcraft merged Merged PR #1568 as commit 1bd531772, preventing LXD from re-injecting identical snaps by comparing hashes instead of revision-based filenames; fixes LP #1716923.
74%
#45 actions: introduce helpers to install & inject snaps (CRAFT-253) craft-providers merged PR #45 (commit 5e8109c, merged via 3573b67) added snap_installer.install_from_store() and inject_from_host() helpers plus installed_snap/core20_lxd_instance test fixtures, with unit and integration tests.
72%
#343 lxd should be a suggestion, not a direct dep snapcraft merged Merged in snapcraft PR #343 as 7147a43ba, changing LXD from a direct dependency to a suggestion and resolving LP #1550381.
71%
#585 fix: check if lxd snap is installed craft-providers merged Merged #585 via c62b1e2, replacing LXD PATH executable detection with a snapd socket query so auto-installer stubs are handled correctly.
71%
#1263 lxd: pass through commands into the container snapcraft merged Merged #1263 as commit e0f28bd5c, routing snap-building and parts commands through LXD containers so remote/cleanbuild commands run inside the container environment.
71%