← 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

Destructive-mode clean leaves the .craft build-state directory behind; the report has an exact reproducer on Snapcraft 8.13.2 but remains untriaged.

Suggested action: needs triage

Reason: The report provides an exact Snapcraft 8.13.2 reproduction: after destructive pack and clean, .craft remains alongside the .snap. Snapcraft's CleanCommand delegates to craft-application, while the destructive clean spread test only checks parts, stage, and prime, so ownership and expected .craft cleanup need investigation. With no labels, comments, or maintainer assessment, this valid, well-scoped report should enter triage.

Evaluated by: mr-cal-bot

Impact: 40 Quick Win: 19 Complexity: 44 Confidence: 89 Actionability: 86

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
stealth/space-bunny-alpha
Impact: 40
Quick Win: 19
Complexity: 44
Confidence: 89
Actionability: 86
needs triage Destructive-mode clean leaves the .craft build-state directory behind; the report has an exact reproducer on Snapcraft 8.13.2 but remains untriaged.
stealth/space-bunny-alpha
Impact: 30
Quick Win: 19
Complexity: 28
Confidence: 88
Actionability: 88
needs triage A reproducible Snapcraft 8.13.2 cleanup bug leaves the .craft work directory after a destructive pack/clean cycle; it has no labels, discussion, or identified fix.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 24
Complexity: 30
Confidence: 75
Actionability: 85
keep open snapcraft clean --destructive fails to delete .craft directory after snapcraft pack --destructive. Clear reproduction steps provided, issue remains open with no maintainer response.
qwen/qwen3.8-27b
Impact: 30
Quick Win: 22
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.

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 Added --destructive-mode support to snapcraft clean in snapcore/snapcraft PR #2577, enabling host-side project artifact cleanup.
76%