← Back to issue list

`charmcraft pack` for existing environment does not remove files that have been deleted

View original Github issue

Metadata

Project
charmcraft
Number
#746
Type
issue
State
closed
Author
ca-scribner
Labels
—
Created
Updated
Closed

Current evaluation

Closed as a duplicate of charmcraft#710 by maintainer facundobatativa (facundobatista) on 2022-04-13. #710 remains open, with the root cause tracked upstream in craft-parts#851.

Resolution: closed superseded

Reason: Maintainer facundobatista closed it with the comment "Dup of #710", where the identical stale-file-on-repack behaviour is still tracked. #710 in turn points at upstream craft-parts#851 (local-source updates leave deleted files in the part), which is still open, so no fix shipped for this report.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed superseded Closed as a duplicate of charmcraft#710 by maintainer facundobatativa (facundobatista) on 2022-04-13. #710 remains open, with the root cause tracked upstream in craft-parts#851.
stealth/space-bunny-alpha — closed superseded Closed as a duplicate of charmcraft#710, where the same stale-file-on-repack behaviour is still tracked as open; root cause of local-source updates leaving deleted files in the part sits upstream in craft-parts#851.
stealth/space-bunny-alpha — closed superseded Closed as a duplicate of canonical/charmcraft#710; that issue remains open, with the underlying stale-file behavior tracked in canonical/craft-parts#851.
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.

Update history

No update history recorded yet.

Related work

  • Duplicate Of: canonical/charmcraft#710 (confidence 98%)

    Explicitly cited in the closing comment; same stale-file-on-repack bug, still open.

  • Blocked By: canonical/craft-parts#851 (confidence 88%)

    Upstream craft-parts issue where local-source updates leave removed files in the part; root cause per #710.

Related issues

Issue Project State Summary Similarity
#710 `charmcraft pack` retains no longer existing files from previous packs charmcraft open Repacking reuses the part's build container, so files deleted from the working tree linger in the resulting charm until `charmcraft clean <part>`. Maintainers confirmed it still reproduces; root cause tracked upstream in craft-parts#851.
85%
#501 charmcraft pack fails trying to include a non-existing charm/src/.tox/ charmcraft closed The missing-file packing failure was fixed upstream in craft-parts; maintainer lengau closed charmcraft#501 on 2024-02-22 as resolved.
76%
#552 `charmcraft pack` runs indefinitely when using parts charmcraft closed The hang was caused by duplicated local-source ignore patterns in Charmcraft 1.2.1 and fixed in 1.3.0 via canonical/craft-parts#120 (commit 280e1592).
74%
#907 `charmcraft pack` does not handle updating a file's execution permissions without a `charmcraft clean` charmcraft open charmcraft pack keeps stale file permissions in the build container unless `charmcraft clean` is run; root cause is craft-parts' outdated check only comparing mtime. Reproduced upstream, workaround `touch` documented, still open.
73%
#1160 `charmcraft pack` does not recognize updated `charmcraft.yaml` file charmcraft open Tracked upstream: charmcraft pack ignores build-snaps channel changes in charmcraft.yaml unless clean is run. Root cause is craft-parts#496 (build-snaps missing from properties_of_interest), still unfixed; charmcraft only needs a craft-parts bump once patched.
73%
#1338 `charmcraft clean` doesn't clean charmcraft closed Closed unresolved: LXD cleanup remained broken in Charmcraft 3, with the changed behavior attributed to craft-application#425, which also closed without a linked fix.
71%