lxd: distinguish argless clean from clean -s pull
Metadata
Current evaluation
Merged in snapcraft#1655 (ed32603c7), fixing LXD cleanup so bare clean removes build containers while clean -s pull preserves or recreates them.
Resolution: closed resolved
Reason: PR #1655 was approved, manually tested, and merged as commit ed32603c7, resolving bug 1727445 by distinguishing full cleanup from pull-only cleanup.
Evaluated by: mr-cal-bot
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 1727445](https://bugs.launchpad.net/snapcraft/+bug/1727445).
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in snapcraft#1655 (ed32603c7), fixing LXD cleanup so bare clean removes build containers while clean -s pull preserves or recreates them. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #1655 (ed32603c7), fixing LXD cleanup so argless snapcraft clean removes build containers while clean -s pull preserves or recreates them. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for bug 1727445 distinguishing argless snapcraft clean from snapcraft clean -s pull in LXD. Approved by one reviewer, passed CI, and verified via manual testing. Changes span three files with a minimal diff. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix for bug 1727445 modifying LXD to distinguish argumentless clean from clean -s pull. Containers are now only removed during full cleanup, preserving them for stage-specific operations. Verified via manual testing. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1434 lxd: clean with no parts should only delete | snapcraft | merged | Merged #1434 in commit 33c7a6bc1, making argless LXD clean delete container resources without executing commands inside the container. | |
| #1769 lxd: add an --image argument to cleanbuild | snapcraft | closed | Closed unmerged as stale after Snapcraft moved from container builds toward VMs, abandoning LXD cleanbuild --image support. | |
| #1666735 snapcraft cleanbuild does not work with lxd installed via snap | snapcraft (launchpad) | closed | Fixed by merged canonical/snapcraft#1199 (commit 417989880), making cleanbuild LXD detection packaging-independent instead of relying on apt package metadata. | |
| #1746009 clean is checking lxd remote | snapcraft (launchpad) | closed | Snapcraft now initializes the LXD remote lazily, so clean no longer starts a container unnecessarily; fixed by snapcore/snapcraft#1916 (dd4404843). | |
| #1587 lifecycle: clean after deleting container | snapcraft | merged | Merged PR #1587 (commit daca4618b): LXD cleanup logic moved into lxd.py's clean() so `snapcraft clean` removes leftover build containers, addressing the forum-reported container-build clean issue. | |
| #1796980 Remove cleanbuild | snapcraft (launchpad) | closed | Merged snapcore/snapcraft#2335 as 27ec9ba63, removing LXD lifecycle builds for base-based snaps and making cleanbuild redundant for them. | |
| #328 New command cleanbuild (using lxd) | snapcraft | merged | Merged via2f6116267 (branch feature/1480144/cleanbuild-lxd): adds the cleanbuild command building in LXD containers, dropping pylxd due to API/Python 3 breakage. Later fixes followed in #1610, #1807 and #2404. | |
| #1627 lxd: split container classes into different files | snapcraft | merged | Merged in snapcraft#1627 via d2118855c, splitting LXD container classes into separate modules, relocating Cleanbuilder methods and deduplicating environment setup without functional changes. | |
| #1762 lxd: delete container only if parts is empty | snapcraft | merged | Merged PR #1762 (dbce9a058), changing LXD cleanup to delete a build container only after all parts are removed, preserving it for targeted cleans and making repeated cleans safe. | |
| #1752498 cleanbuild fails with lxd snap | snapcraft (launchpad) | closed | Closed as obsolete: the cleanbuild command was removed; Snapcraft builds now perform clean builds by default. |