Destructive mode does not allow for building charms in parallel
Metadata
Current evaluation
Parallel destructive mode builds failed due to shared apt lock paths. Resolved by integrating craft-parts 1.0.1 to namespace build directories by charm name. Fix released in Charmcraft 1.3.0.
Suggested action: —
No scores available.
Issue body
I have a bundle with two charms. When I try to build both charms at the same time with `--destructive-mode`, I get this error:
charmcraft internal error! LockFailedException: Failed to lock directory /home/knkski/snap/charmcraft/common/cache/charmcraft/stage-packages/var/lib/apt/lists/: E:Could not get lock /home/knkski/snap/charmcraft/common/cache/charmcraft/stage-packages/var/lib/apt/lists/lock. It is held by process 128762 (python3) (full execution logs in /home/knkski/snap/charmcraft/common/charmcraft-log-30ipuxhg)
It looks like `charmcraft` is not using the charm's name anywhere in that path, so building multiple charms in parallel simply won't work atm, as they'll fight over the lock.
I realize this is called `--destructive-mode`, but if one accepts that risk then there doesn't seem to be any reason not to namespace the building process/directories by charm name.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | Parallel destructive mode builds failed due to shared apt lock paths. Resolved by integrating craft-parts 1.0.1 to namespace build directories by charm name. Fix released in Charmcraft 1.3.0. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in Charmcraft 1.3.0 by integrating craft-parts 1.0.1. Build directories are now namespaced by charm name, resolving apt lock conflicts that prevented parallel destructive-mode builds. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in Charmcraft 1.3.0 via craft-parts 1.0.1 integration. Cache paths are now namespaced by charm name, resolving apt lock conflicts and enabling parallel destructive mode builds. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in Charmcraft 1.3.0 via craft-parts 1.0.1 integration. Parallel destructive mode builds no longer fail with LockFailedException by namespacing cache directories per charm name. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Parallel destructive-mode builds failed due to shared apt lock paths. Fixed by integrating craft-parts 1.0.1 to namespace build directories by charm name. Released in Charmcraft 1.3.0. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1845 Building multiple charms simultaneously can cause caching errors | charmcraft | closed | Closed. Charmcraft will detect parallel builds and disable caching with a warning to prevent race conditions and zipfile errors during simultaneous charm builds. | |
| #1533 fix: use a "build" subdirectory in destructive mode. | charmcraft | closed | Closed. Implements a build subdirectory in destructive mode to mimic Charmcraft 2.x, modifying three files with minor adjustments. No review comments or CI checks were recorded. |