pip wheel cache ignored
Metadata
Current evaluation
Pip 23 restored use of Charmcraft's shared wheel cache. The fix merged in canonical/charmcraft#1437 (fe263387), was backported by #1723, and shipped in Charmcraft 2.5.4.
Resolution: closed resolved
Reason: PR #1437 raised the minimum pip version to 23, resolving cache misses caused by pip 22's handling of --no-binary package lists. The reporter confirmed 2.5.4 worked in all three tested scenarios before the issue was closed.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
## Expected behavior
After charmcraft LXC containers are deleted, the pip cache added in charmcraft 2.5 is used in the next pack
## Actual behavior
After charmcraft LXC containers are deleted, the next pack takes the same amount of time if the pip cache is present or missing
### To Reproduce
```
sudo snap install charmcraft --channel candidate --classic
git clone https://github.com/canonical/mysql-router-k8s-operator
cd mysql-router-k8s-operator
tox run -e pack-wrapper
mv requirements-last-build.txt requirements.txt
charmcraft pack -v
lxc --project charmcraft ls
lxc --project charmcraft delete base-instance-charmcraft-buildd-base-v20-2046f14fb4a00aa9ce50
lxc --project charmcraft delete charmcraft-mysql-router-k8s-520528-0-0-amd64
time charmcraft pack -v
lxc --project charmcraft delete base-instance-charmcraft-buildd-base-v20-2046f14fb4a00aa9ce50
lxc --project charmcraft delete charmcraft-mysql-router-k8s-520528-0-0-amd64
rm -r ~/snap/charmcraft/common/cache/charmcraft/
time charmcraft pack -v
```
### Environment
Ubuntu 22.04
charmcraft snap rev 1736
### charmcraft.yaml
```shell
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
type: charm
bases:
- build-on:
- name: "ubuntu"
channel: "22.04"
run-on:
- name: "ubuntu"
channel: "22.04"
parts:
charm:
override-pull: |
craftctl default
if [[ ! -f requirements.txt ]]
then
echo 'ERROR: Use "tox run -e build" instead of calling "charmcraft pack" directly' >&2
exit 1
fi
charm-entrypoint: src/kubernetes_charm.py
prime:
- charm_version
- workload_version
- scripts
build-packages:
- libffi-dev
- libssl-dev
- pkg-config
- rustc
- cargo
```
### Relevant log output
```shell
See first comment
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Pip 23 restored use of Charmcraft's shared wheel cache. The fix merged in canonical/charmcraft#1437 (fe263387), was backported by #1723, and shipped in Charmcraft 2.5.4. | |
| stealth/space-bunny-alpha | — | closed resolved | Charmcraft 2.5.4 restored pip wheel-cache reuse by raising the charm builder's minimum pip version to 23 in PR #1437 (fe263387). | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in charmcraft 2.5.4 by PR #1437 (commit fe263387), which raised the charm builder's minimum pip version to 23 so package-specific --no-binary options still use the wheel cache. | |
| stealth/space-bunny-alpha | — | closed resolved | Wheel cache was ignored because Ubuntu 22.04 shipped pip 22, where `--no-binary=[package list]` bypasses the cache. Fixed by PR #1437 (commit fe263387) bumping charm_builder's minimum pip to 23; reporter confirmed 2.5.4 works, so maintainer closed it. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in charmcraft 2.5.4 by #1437 (fe263387), raising the charm builder's minimum pip to 23 so the wheel cache is used again. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in Charmcraft 2.5.4 by upgrading the charm builder’s minimum pip version to 23, restoring pip wheel-cache behavior; the reporter confirmed all three tested scenarios. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in charmcraft 2.5.4 by updating pip to version 23+, resolving the wheel cache issue caused by pip 22's --no-binary handling. Verified by the reporter and closed. | |
| qwen/qwen3.6-35b-a3b | — | — | Resolved in charmcraft v2.5.4 by upgrading pip to version 23. The issue stemmed from pip 22 ignoring the wheel cache when --no-binary specified a package list. Upgrading pip restored correct cache behavior, verified by the reporter. | |
| qwen/qwen3.6-35b-a3b | — | — | Resolved in charmcraft v2.5.4 by upgrading to pip >=23, which correctly respects the wheel cache with specific --no-binary flags. The reporter confirmed the fix across multiple scenarios, and the issue is closed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved in charmcraft v2.5.4 by upgrading to pip >= 23. The upgrade corrects pip 22 behavior where --no-binary package lists ignored the wheel cache. Author verified the fix across all test cases. Issue closed. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#1437
(confidence 100%)
Merged as commit fe263387 and released in Charmcraft 2.5.4.
-
Likely Fixed By:
canonical/charmcraft#1723
(confidence 90%)
Backported the pip version update to the 2.x release line.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1256 Support global cache for pip in charmcraft | charmcraft | closed | Pip global shared caching was added by merged PR #1270 (commit f2353279), enabling wheel reuse across containers; test PR #1249 was closed unmerged. | |
| #1437 fix(charm_builder): bump minimum pip version to 23 | charmcraft | merged | Merged #1437 in commit fe263387, raising charm_builder's minimum pip to 23 so strict dependencies use the prebuilt wheel cache; released in Charmcraft 2.5.4. | |
| #1716 feat: upgrade minimum pip version | charmcraft | merged | Merged in canonical/charmcraft#1716 (def89c50), raising Charmcraft's minimum required pip version; the update was backported to 2.x by #1723 (5e119c36). | |
| #1723 fix: backport pip version update to 2.x | charmcraft | merged | Backported the pip version update to the 2.x branch and merged it in canonical/charmcraft#1723 via commit 5e119c36. | |
| #1865 fix: make version work from wheel | charmcraft | merged | Merged PR #1865 as commit 59f475af, making Charmcraft resolve its version from installed wheel metadata when generated version data is unavailable; fixes #1472. |