build providers: support injection for LXD
Metadata
Current evaluation
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.
Suggested action: —
No scores available.
Issue body
By use of snapd's new snaps/<snap-name>/file API.
This also removes the use of mounts and leverages file
pushing.
Refactoring has been done for a better separation of concerns.
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Implements LXD injection support using snapd's file API, replacing mount usage with file pushing and refactoring for improved separation of concerns. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Implements LXD build provider injection support using snapd's file push API, eliminating mount dependencies. Refactors code to improve separation of concerns. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #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. | |
| #2509 build providers: initial support for LXD | snapcraft | merged | Merged initial LXD build provider support for snapcraft, enabling the --use-lxd flag for lifecycle steps and cleaning. Passes CI. Reviewers noted minor dependency and container setup edge cases, which were clarified or deferred. | |
| #2647 build providers: catch LXD socket error | snapcraft | merged | Merged to catch LXD socket errors in build providers, resolving SNAPCRAFT-WA. Approved by reviewer, passed CI checks, and integrated with a 14-line addition and 6-line deletion across three files. Minor test coverage decrease noted but did not block merge. | |
| #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. | |
| #2773 build providers: inject snapd snap for latest feature availability | snapcraft | merged | Merged changes that inject the snapd snap into build providers instead of core, improving feature availability and reducing size. Approved by reviewer, passed CI, and modified 4 files (+59/-12 lines). | |
| #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. | |
| #1199 cleanbuild: packaging independent detection. | snapcraft | merged | Merged changes making LXD detection packaging-independent for snap and manual installs. Detection logic moved from lifecycle to the lxd module, eliminating the translation layer. Approved, passed CI, and merged across four files. | |
| #2966 build providers: move to buildd images | snapcraft | merged | Merged. Moves build providers to buildd images, enabling multi-architecture and core20 support for LXD. Approved, passed CI, and addressed reviewer feedback on network wait logic. | |
| #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. | |
| #2964 build providers: remove LXD specific env setup | snapcraft | merged | Merged. Removes LXD-specific environment setup from build providers since Provider._get_env_command already handles it. Approved by reviewer, passed CI, and successfully integrated. |