← Back to issue list

snapcraft cleanbuild shouldn't always delete container at end

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1746381
Type
issue
State
closed
Author
~popey
Labels
—
Created
Updated
Closed

Current evaluation

No fix was made: maintainers confirmed cleanbuild containers were disposable, recommended SNAPCRAFT_CONTAINER_BUILDS, and left the request for default failure shells unimplemented.

Resolution: closed stale

Reason: After the February 2018 discussion ended without a patch or closing rationale, the request remained abandoned. PR #1404 previously added a shell only for explicit `cleanbuild --debug` failures, not container retention or a default shell.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Building a snap using 'snapcraft cleanbuild' at the end there was a problem getting the snap out of the container, covered by bug 1746380. However, snapcraft immediately then threw away the container meaning I couldn't recover the snap manually, nor debug the issue. Snapping 'pyradio' / Snapped pyradio_1.3.2_amd64.snap error: open /var/lib/snapd/hostfs/home/alan/tmp/pyradio/pyradio_1.3.2_amd64.snap: permission denied Stopping local:snapcraft-saltishly-unsurgical-blondell Traceback (most recent call last): File "/snap/snapcraft/1069/bin/snapcraft", line 11, in <module> load_entry_point('snapcraft==2.38', 'console_scripts', 'snapcraft')() Perhaps snapcraft shouldn't trash the container given a successful snap was made, it just couldn't be recovered from the container?

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed stale No fix was made: maintainers confirmed cleanbuild containers were disposable, recommended SNAPCRAFT_CONTAINER_BUILDS, and left the request for default failure shells unimplemented.
stealth/space-bunny-alpha — closed stale Request to retain cleanbuild containers was abandoned after maintainers confirmed the disposable-container behavior and pointed users to SNAPCRAFT_CONTAINER_BUILDS; no fix was merged.
stealth/space-bunny-alpha — closed stale Closed without implementation after years of inactivity; the request to retain a cleanbuild container for manual snap recovery and debugging received no recorded fix.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The request to retain the container post-build for debugging was not implemented and the issue was abandoned.
qwen/qwen3.6-35b-a3b — — Closed without implementation. The request to preserve the container after a successful build for debugging was not addressed, likely abandoned or superseded by newer workflows.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The request to retain the container after successful builds but failed extraction was abandoned. No fix or merge occurred.
qwen3.6-35b-a3b-mtp-q6 — — Requesting snapcraft cleanbuild to preserve containers after build failures was closed without resolution. No fix was implemented, leaving the feature abandoned.

Update history

Date Change
created

Related work

  • Related To: canonical/snapcraft#1404 (confidence 96%)

    Merged as commit 4baa19e3c to open a shell for failures under `cleanbuild --debug`; it did not satisfy the broader request.

Related issues

Issue Project State Summary Similarity
#1816042 snapcraft cleanbuild fails if container isn't fully ready snapcraft (launchpad) closed Closed as obsolete: @sergiusens said cleanbuild was no longer supported because normal builds now transparently provide clean builds.
80%
#1372 cli: Containerbuild clean snapcraft merged Merged #1372, adding a unit test and fixing full clean behavior for SNAPCRAFT_CONTAINER_BUILDS=1.
77%
#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.
76%
#2044389 snapcraft clean failed but exit 0 snapcraft (launchpad) open Snapcraft 7.5.3 reports a missing build environment during clean but exits 0; a maintainer confirmed the bug and agreed it should fail, with no fix recorded.
74%
#1746359 snapcraft cleanbuild --debug should provide guidance on build failure snapcraft (launchpad) closed Superseded by Snapcraft 3.x base-based build environments, which replaced the legacy cleanbuild --debug container workflow.
74%
#1729069 snapcraft container builds with snap try snapcraft (launchpad) closed Closed without a documented fix; snap try failing when container builds are enabled remained unresolved and was abandoned after years of inactivity.
74%
#1697979 snapcraft fails on initial cleanbuild probe snapcraft (launchpad) closed Closed as obsolete: cleanbuild was decommissioned, and standard Snapcraft builds now transparently use a clean build environment.
73%
#1800119 snapcraft cleanbuild snapcraft (launchpad) closed The obsolete cleanbuild command was retired because builds became clean by default; a maintainer closed the report in August 2023.
73%
#1734145 snapcraft clean <part-name> destroys everything when using containers snapcraft (launchpad) closed Fixed targeted container cleanup: `snapcraft clean <part>` no longer deletes the LXD container while other parts remain; merged in #1762 (dbce9a058).
72%
#1727445 Container destroyed on snapcraft clean -s pull snapcraft (launchpad) closed Fixed by snapcraft PR #1655, which corrected clean-step handling so cleaning the pull step no longer unnecessarily destroys the build container.
72%