Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

charmcraft pack retains no longer existing files from previous packs #710

Open
sed-i opened this issue Mar 11, 2022 · 6 comments
Open

charmcraft pack retains no longer existing files from previous packs #710

sed-i opened this issue Mar 11, 2022 · 6 comments
Assignees
Labels
Bug Something isn't working triaged

Comments

@sed-i
Copy link
Contributor

sed-i commented Mar 11, 2022

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
@PietroPasotti
Copy link

I've encountered the same issue several times in the past

@PietroPasotti
Copy link

will keep my eyes peeled on whether it still occurs on latest release

@facundobatista
Copy link
Contributor

It's a known bug, so yes, still there in latest release (sorry).

Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3422.

This message was autogenerated

@lengau
Copy link
Collaborator

lengau commented Sep 20, 2024

Confirmed this is still an issue. I've made an upstream bug report: canonical/craft-parts#851

@lengau
Copy link
Collaborator

lengau commented Oct 8, 2024

Workaround for this: you can clean a specific part without destroying the build container with charmcraft clean <part-name>. e.g. charmcraft clean charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

5 participants