`charmcraft pack` runs indefinitely when using parts
Metadata
Current evaluation
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).
Resolution: closed resolved
Reason: The ignore-pattern accumulation bug was fixed by canonical/craft-parts#120, commit 280e1592, and released in Charmcraft 1.3.0. The reporter confirmed they were using 1.2.1 and planned to update.
Evaluated by: mr-cal-bot
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 |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | 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). | |
| stealth/space-bunny-alpha | — | closed resolved | The hang was caused by craft-parts repeatedly mutating ignore patterns, fixed by canonical/craft-parts#120 (commit 280e1592) and included in Charmcraft 1.3.0. | |
| stealth/space-bunny-alpha | — | closed resolved | Repeated ignore patterns that stalled `charmcraft pack` were fixed in Charmcraft 1.3.0 via craft-parts PR #120 (commit 280e1592); the reporter was using 1.2.1. | |
| 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. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-parts#120
(confidence 98%)
Merged fix for local-source ignore-pattern repetition, included in Charmcraft 1.3.0.
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. | |
| #746 `charmcraft pack` for existing environment does not remove files that have been deleted | charmcraft | closed | 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. | |
| #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. | |
| #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. | |
| #1791 Charmcraft 3 including previously-built charms in new charm builds | charmcraft | closed | Fixed in PR #1793 (commit affc209b): subsequent charmcraft pack runs no longer include previously built .charm artifacts in the new charm. | |
| #701 `charmcraft pack` doesn't include all error output | charmcraft | closed | Missing charmcraft pack error output was fixed in Charmcraft 1.5 through improved managed-instance log retrieval; the reporter was using 1.4.0, so the issue was closed. | |
| #1697 Charmcraft 3 breaks charms with multiple run-on architectures | charmcraft | closed | Closed as blocked by canonical/craft-application#394; no resolving Charmcraft PR, commit, or release was identified for the multi-architecture regression. |