← Back to issue list

snapcraft cleanbuild does not work with lxd installed via snap

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1666735
Type
issue
State
closed
Author
~thomir-deactivatedaccount
Labels
—
Created
Updated
Closed

Current evaluation

Fixed by merged canonical/snapcraft#1199 (commit 417989880), making cleanbuild LXD detection packaging-independent instead of relying on apt package metadata.

Resolution: closed resolved

Reason: PR canonical/snapcraft#1199 merged as commit 417989880 and replaced repository-based LXD checks with packaging-independent detection, allowing the snap-installed LXD to work.

Evaluated by: mr-cal-bot

No scores available.

Issue body

The 'snapcraft cleanbuild' command checks to see if lxd is installed. Sadly it does this by checking the apt package cache, which means that users using lxd from the snap package can't use the cleanbuild command, despite the fact that there's no technical reason (as far as I can see anyway) why this wouldn't work. Can we check the output of 'snap list' to see if the lxd snap is present? Alternatively, perhaps just ensure that a safe lxd command exits 0 (perhaps 'lxc list').

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged canonical/snapcraft#1199 (commit 417989880), making cleanbuild LXD detection packaging-independent instead of relying on apt package metadata.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/snapcraft#1199 (commit 417989880), making cleanbuild LXD detection packaging-independent for snap and manual installations.
stealth/space-bunny-alpha — closed stale Closed with no documented fix after years of inactivity; no resolving PR or commit was identified for detecting LXD installed through snap.
qwen/qwen3.6-35b-a3b — — Closed without resolution or merge. The report notes snapcraft cleanbuild fails to detect LXD installed via snap, suggesting checks via snap list or lxc list instead of apt cache. No fix was implemented or documented.
qwen/qwen3.6-35b-a3b — — Closed as abandoned due to inactivity. The report noted snapcraft cleanbuild fails to detect LXD installed via snap, suggesting alternative detection methods. No fix was implemented or merged.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#1199 (confidence 100%)

    Merged PR cited in the issue comment; it directly changed cleanbuild's LXD installation detection.

Related issues

Issue Project State Summary Similarity
#1703344 snapcraft cleanbuild exits with a traceback when lxd is not installed snapcraft (launchpad) closed Fixed cleanbuild’s traceback when LXD is absent by handling the missing lxc executable and reporting a clear error. Merged in snapcraft#1400.
84%
#1746612 Snapcraft cleanbuild doesn't work if you're not using the LXD snap snapcraft (launchpad) closed Closed after the missing hostfs behavior was fixed upstream in lxc/lxd#4183. Snapcraft PR #1912 offered a workaround but was not merged.
81%
#1199 cleanbuild: packaging independent detection. snapcraft merged Merged in canonical/snapcraft#1199 (commit 417989880), replacing repo-based LXD checks with packaging-independent detection and moving the logic into the LXD module.
81%
#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.
80%
#1689712 snapcraft cleanbuild fails in xenial with the lxd deb: KeyError: 'kernel_architecture' snapcraft (launchpad) closed Fixed Xenial cleanbuild compatibility with older LXD metadata in snapcore/snapcraft PR #1305, merged as commit 8f15f697f.
79%
#1788654 snapcraft cleanbuild doesn't work with cross-compile stage-packages snapcraft (launchpad) closed Closed as an obsolete legacy cleanbuild/LXD issue after a maintainer directed users to migrate to bases; no targeted cross-architecture fix was recorded.
79%
#1570706 Snapcraft cleanbuild command doesn't work snapcraft (launchpad) closed Fixed by merged canonical/snapcraft PR #458 (f78b1e3a3), which corrected Cleanbuilder constructor arguments so snapcraft cleanbuild could initialize its container.
77%
#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.
76%
#1839399 snapcraft not pulling snap from lxd container snapcraft (launchpad) open Snapcraft 3.7.1 reported a successful --use-lxd build but left the generated snap absent on the host; a maintainer identified possible CWD handling, and the case remains unresolved.
76%
#1655 lxd: distinguish argless clean from clean -s pull snapcraft merged Merged in snapcraft#1655 (ed32603c7), fixing LXD cleanup so bare clean removes build containers while clean -s pull preserves or recreates them.
76%