← Back to issue list

`snapcraft clean --destructive` does not delete `.craft` directory

View original Github issue

Metadata

Project
snapcraft
Number
#6001
Type
issue
State
open
Author
steinbro
Labels
Created
Updated
Closed

Current evaluation

Bug report: `snapcraft clean --destructive` leaves the `.craft` directory behind after `snapcraft pack --destructive`. Reported by a maintainer with full reproduction steps on Snapcraft 8.13.2; no labels, no comments, no maintainer response in 213 days.

Suggested action: needs triage

Reason: The issue has zero comments, no labels, and no maintainer acknowledgement despite being filed by a maintainer (steinbro) 213 days ago, so it has never been triaged. The bug is real and reproducible (clean output shows `.craft` surviving while parts/prime/stage/overlay are removed), and the clean command lives in craft-application's lifecycle.py where the destructive-mode path calls lifecycle.clean() without removing the craft-parts state directory, so it remains a valid, actionable bug rather than stale or not-a-bug.

Impact: 30 Quick Win: 22.5 Staleness: 75 Complexity: 25 Confidence: 70 Support Request: 5

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description After `snapcraft pack` is run in destructive mode, running `snapcraft clean --destructive` removes all expected directories except for `.craft`. ### Steps to reproduce ``` root@snapcraft-test:~# cd `mktemp -d` root@snapcraft-test:/tmp/tmp.9TIyHpcaEM# snapcraft init See https://documentation.ubuntu.com/snapcraft/stable/reference/project-file for reference information about the snapcraft.yaml format. Successfully initialised project. root@snapcraft-test:/tmp/tmp.9TIyHpcaEM# ls -a . .. snap root@snapcraft-test:/tmp/tmp.9TIyHpcaEM# snapcraft pack --destructive Packed my-project_0.1_amd64.snap root@snapcraft-test:/tmp/tmp.9TIyHpcaEM# ls -a . .. .craft my-project_0.1_amd64.snap overlay parts prime snap stage root@snapcraft-test:/tmp/tmp.9TIyHpcaEM# snapcraft clean --destructive root@snapcraft-test:/tmp/tmp.9TIyHpcaEM# ls -a . .. .craft my-project_0.1_amd64.snap snap ``` ### Environment Snapcraft 8.13.2 on Ubuntu 24.04 in an LXD container ### snapcraft.yaml ```yaml ``` ### Log output ```shell ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 30
Quick Win: 22.5
Staleness: 75
Complexity: 25
Confidence: 70
Support Request: 5
needs triage Bug report: `snapcraft clean --destructive` leaves the `.craft` directory behind after `snapcraft pack --destructive`. Reported by a maintainer with full reproduction steps on Snapcraft 8.13.2; no labels, no comments, no maintainer response in 213 days.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 25
Confidence: 75
Support Request: 10
needs triage Unlabelled bug report stating snapcraft clean --destructive fails to remove the .craft directory after packing. No maintainer comments or labels after 172 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 20
Confidence: 75
Support Request: 5
needs triage snapcraft clean --destructive fails to remove the .craft directory after a destructive build. Unlabelled and unresponded to for 158 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 60
Complexity: 25
Confidence: 90
Support Request: 10
needs triage snapcraft clean --destructive leaves the .craft directory behind after packing. Open 136 days with no comments or labels. Needs triage and assignment to fix the cleanup logic.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1827191 --destructive-mode is not available in `snapcraft clean` snapcraft (launchpad) closed Closed without resolution. The snapcraft clean command lacks --destructive-mode support; users are advised to use SNAPCRAFT_BUILD_ENVIRONMENT=host as a workaround.
70%