`charmcraft pack` runs indefinitely when using parts
Metadata
Current evaluation
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.
Suggested action: —
No scores available.
Issue body
Intermittently when doing `charmcraft pack` I am hitting a `pack` that will run indefinitely. This has happened when using a 'charmcraft.yaml' file that includes:
```
parts:
kubectl:
plugin: dump
source: .
override-pull: |
curl -sSLO https://dl.k8s.io/release/v1.22.1/bin/linux/amd64/kubectl
chmod +x kubectl
build-packages:
- curl
```
Where the logs show I'm stuck on:
```
2021-09-21 15:19:53,069 craft_parts.executor.executor DEBUG execute action charm:Action(part_name='charm', step=Step.PULL, action_type=ActionType.UPDATE, reason='source changed').
```
I cannot consistently reproduce this, but when it does happen it will continually happen (kill+rerun `charmcraft pack` yields the same result). Deleting the `./build` directory seems to fix the issue and the next pack will work fine.
When this error does occur, a few lines above the stuck action I see:
```
2021-09-21 15:26:54,885 craft_parts.sources.local_source DEBUG ignore patterns: ['*.charm', 'build', '*.charm' ...]
```
where the `...` has **many** repeats of "'*.charm', 'build'" (enough to fill my terminal history).
Something similar can be reproduced by using the above `charmcraft.yaml` snippet to `pack` the `charmcraft init` template twice in a row. The first `charmcraft pack` will show a small entry for ignore patterns, with the second `pack` showing something like:
```
2021-09-22 18:34:08,551 craft_parts.sources.local_source DEBUG ignore patterns: ['*.charm', 'build', '*.charm', 'build', '*.charm', 'build', '*.charm', 'build', 'build', '*.charm', 'build', '*.charm', 'build', '*.charm', 'build', '*.charm', 'build', 'build', '*.charm', 'build', '*.charm', 'build', '*.charm', 'build', '*.charm', 'build', 'build', '*.charm', 'build', '*.charm', 'build', '*.charm', 'build', '*.charm', 'build', 'build', 'build', 'build']
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | 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. | |
| qwen/qwen3.6-35b-a3b | — | — | The charmcraft pack hang was caused by a duplicate ignore patterns bug. It was resolved in Charmcraft 1.3.0. The author closed the issue after realizing they were on version 1.2.1 and planned to upgrade. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Infinite hang from repeated ignore patterns was fixed in Charmcraft 1.3.0. Reporter confirmed using version 1.2.1 and will reopen if the issue persists after upgrading. Closed as resolved by version upgrade. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved by upgrading to Charmcraft 1.3.0, which fixed the ignore pattern duplication bug causing the hang. The author closed the issue after confirming they were running version 1.2.1. |
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. | |
| #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. | |
| #746 `charmcraft pack` for existing environment does not remove files that have been deleted | charmcraft | closed | 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. | |
| #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. | |
| #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. | |
| #701 `charmcraft pack` doesn't include all error output | charmcraft | closed | Fixed in Charmcraft 1.5 via improved instance-internal log retrieval, ensuring full build error output is captured. Closed by maintainer pending user verification on the updated version. | |
| #1747 Failed to run the build script for part 'charm' | charmcraft | closed | Build script failure during charmcraft pack was resolved. The issue was closed after the maintainer acknowledged the report and merged the fix in PR #1751. | |
| #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. |