`charmcraft pack` for existing environment does not remove files that have been deleted
Metadata
Current evaluation
Closed as a duplicate of issue #710. The charmcraft pack command was reported to retain deleted files in the charm archive across builds. Resolution and tracking are handled in the referenced duplicate issue.
Suggested action: —
No scores available.
Issue body
### What happened
If you:
* `charmcraft pack`' a charm
* then delete a local file
* `charmcraft pack` again
The deleted file does not get removed from the `.charm`
### Expected behaviour
That `charmcraft pack` would produce a charm that reflects what is in my current directory (in this case, **without** the deleted file), regardless of whether it has been run previously or not. Or, that `charmcraft pack` will fail in cases where it cannot produce a charm reflecting my current directory (and that it gives a helpful error suggesting how to resolve)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as a duplicate of issue #710. The charmcraft pack command was reported to retain deleted files in the charm archive across builds. Resolution and tracking are handled in the referenced duplicate issue. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as a duplicate of issue #710. The charmcraft pack command fails to remove deleted files from the generated charm package on subsequent builds, leaving stale files in the output. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as a duplicate of issue #710. charmcraft pack retains deleted files in the .charm archive rather than reflecting the current directory state. Resolution and tracking continue in the referenced duplicate issue. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as a duplicate of issue #710. The charmcraft pack bug failing to remove deleted files from the output charm package was superseded by the parent tracking issue. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #710 `charmcraft pack` retains no longer existing files from previous packs | charmcraft | open | charmcraft pack includes files deleted from the working directory in the charm archive; clean fixes it. Triaged as a known bug, re-confirmed present in Oct 2024, upstream craft-parts bug filed, per-part clean workaround documented. | |
| #552 `charmcraft pack` runs indefinitely when using parts | charmcraft | closed | The charmcraft pack hang was caused by a duplicate ignore patterns bug. This was fixed in Charmcraft 1.3.0. The author confirmed they would upgrade and close the issue pending recurrence. | |
| #501 charmcraft pack fails trying to include a non-existing charm/src/.tox/ | charmcraft | closed | charmcraft pack failed when copying non-existent build directories or files. Users worked around it with charmcraft clean. The issue was closed as fixed upstream in the underlying parts lifecycle code. | |
| #1530 Changing charmcraft.yaml doesn't update the resulting charm's metadata.yaml | charmcraft | open | Bug: editing charmcraft.yaml then re-running `charmcraft pack` does not update the resulting charm's metadata.yaml. Filed by a maintainer (lengau); last comment (2024-09-09) says it's unclear if still reproducible. Related open craft-application#821 describes the same 'Already packed' skip behavior. | |
| #694 charmcraft pack should have a 'quick' option to override certain folders in an existing .charm file | charmcraft | closed | Closed as a duplicate of issue #731. Maintainers directed users to the existing tracking issue for incremental build optimizations and noted destructive mode as an alternative to containerized packing. | |
| #1160 `charmcraft pack` does not recognize updated `charmcraft.yaml` file | charmcraft | open | charmcraft pack ignores updated build-snaps channel in charmcraft.yaml without a clean; tracked as a craft-parts bug (canonical/craft-parts#496, still open) awaiting a dependency patch release to pull into charmcraft. | |
| #907 `charmcraft pack` does not handle updating a file's execution permissions without a `charmcraft clean` | charmcraft | open | charmcraft pack ignores local file permission changes (e.g., chmod +x on src/charm.py) until a full charmcraft clean, causing confusing lint errors. Maintainer reproduced and filed upstream craft-parts#311; still unfixed. |