← Back to issue list

`charmcraft pack` retains no longer existing files from previous packs

View original Github issue

Metadata

Project
charmcraft
Number
#710
Type
issue
State
open
Author
sed-i
Labels
Status: Triaged Type: Bug
Created
2022-03-11 05:37:00+00:00
Updated
2025-09-17 21:14:10+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

When I repack a charm, the resulting charm has a file that no longer exists in the working directory: ``` > $ ls src/prometheus_alert_rules total 16K drwxrwxr-x 2 tux tux 4.0K Mar 10 15:00 . drwxrwxr-x 5 tux tux 4.0K Mar 10 15:00 .. -rw-rw-r-- 1 tux tux 323 Mar 10 15:00 always_firing_absent.rule -rw-rw-r-- 1 tux tux 301 Mar 10 15:00 always_firing_numeric.rule > $ charmcraft pack Charms packed: avalanche-k8s_ubuntu-20.04-amd64.charm > $ unzip -l avalanche-k8s_ubuntu-20.04-amd64.charm | grep always_firing 306 2021-12-01 19:21 src/prometheus_alert_rules/always_firing.rule 323 2022-03-10 20:00 src/prometheus_alert_rules/always_firing_absent.rule 301 2022-03-10 20:00 src/prometheus_alert_rules/always_firing_numeric.rule ``` Note how `src/prometheus_alert_rules/always_firing.rule` doesn't exist in the workdir, but is present in the archive. This issue went away after `clean`: ``` > $ charmcraft clean Cleaned project 'avalanche-k8s'. > $ charmcraft pack Charms packed: avalanche-k8s_ubuntu-20.04-amd64.charm > $ unzip -l avalanche-k8s_ubuntu-20.04-amd64.charm | grep always_firing 323 2022-03-10 20:00 src/prometheus_alert_rules/always_firing_absent.rule 301 2022-03-10 20:00 src/prometheus_alert_rules/always_firing_numeric.rule ``` ## Environment - Charmcraft 1.4.0 - lxd 4.23

Evaluation history

No evaluation history available.