Crash with `charmcraft pack`
Metadata
Current evaluation
Closed as an upstream Jinja2/setuptools packaging interaction; removing Jinja2 or preinstalling newer pip and setuptools through charm-python-packages restored packing.
Resolution: closed not a bug
Reason: The closing maintainer concluded that Jinja2's packaging assumptions and pip's error reporting caused the failure, with updating pip/setuptools by default as the only potential mitigation. PR #553 had added charm-python-packages, enabling the documented tooling workaround.
Evaluated by: mr-cal-bot
No scores available.
Issue body
First time I try packing a new charm I'm developing...
```
$ uname -a
Linux darkstar 5.13.0-35-generic #40~20.04.1-Ubuntu SMP Mon Mar 7 09:18:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
```
Charm source at https://github.com/PietroPasotti/traefik-route-k8s-operator.git
commit 511a5e9
[charmcraft-20220401-085155.047782.log](https://github.com/canonical/charmcraft/files/8395424/charmcraft-20220401-085155.047782.log)
The second time around, the output is a bit cleaner, but still fails on importing `markupsafe`.
[charmcraft-20220401-090524.694039.log](https://github.com/canonical/charmcraft/files/8395449/charmcraft-20220401-090524.694039.log)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an upstream Jinja2/setuptools packaging interaction; removing Jinja2 or preinstalling newer pip and setuptools through charm-python-packages restored packing. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an upstream Jinja2 packaging/tooling issue; removing Jinja2 or preinstalling newer setuptools and pip via charm-python-packages restored packing. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an upstream Jinja2/setuptools packaging issue; removing Jinja2 or declaring newer setuptools and pip in charm-python-packages restored packing. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as a dependency/environment issue: Jinja2 required newer setuptools and pip; removing it or declaring both in charm-python-packages restored packing. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as an upstream Jinja2/setuptools packaging issue. Removing Jinja2 or specifying newer setuptools and pip under charm-python-packages resolved packing. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed. The crash stemmed from outdated setuptools and pip failing to build jinja2. Resolved via a workaround specifying newer setuptools and pip in charmcraft.yaml. Maintainers attributed the error to upstream packaging and pip limitations. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed. Outdated setuptools and pip in the build container cause jinja2 import failures. Workaround: specify newer setuptools and pip in charmcraft.yaml. Maintainers declined to improve error messages, as the failure originates from pip. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed. The crash stemmed from jinja2 requiring a newer setuptools/pip than the default build container. Maintainers deemed it an upstream limitation, recommending adding charm-python-packages to charmcraft.yaml or removing jinja2. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/charmcraft#553
(confidence 98%)
Merged PR added charm-python-packages, enabling newer pip and setuptools to be preinstalled.
-
Duplicate Of:
canonical/charmcraft#551
(confidence 94%)
The earlier report described the same Jinja2 packing failure.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #551 [charmcraft 1.3]: Cannot pack a charm with Jinja2 as dependency | charmcraft | closed | Jinja2 pack failure in charmcraft 1.3 was traced to old setuptools in the build venv. Resolved by merged PR #553 (ccec8b7e, commit 4b2d291b) adding a charm-python-packages charm plugin property, letting charms preinstall setuptools. | |
| #566 Error when building with charmcraft from edge | charmcraft | closed | Closed by facundobatista as a duplicate of #551 (Jinja2/setuptools packing failure in 1.3 edge). Resolved via merged PR #553 (ccec8b7e, commit 4b2d291b) adding charm-python-packages; workaround is adding setuptools/pip. | |
| #922 Unable to pack charms on a GCP instance | charmcraft | closed | Closed as not a Charmcraft bug: Focal's old setuptools broke pip's wheel installation. Preinstalling setuptools via charm-python-packages works around it; #923 tracked the same regression. | |
| #639 Can't build charm: Failed to build charm for bases index '0' | charmcraft | closed | Closed as a dependency/configuration issue: adding setuptools fixed Jinja2 packing, while Tempita required setuptools <58. A later build recovered after charmcraft clean. |