Packing fails on focal when a dependency is both in requirements.txt and a carm lib's PYDEPS
Metadata
Current evaluation
Resolved in Charmcraft 2.4.1 via pip hotfixes merged in PR #1211 (commit 5d9bf14d); the reporter confirmed packing now works on Focal.
Resolution: closed resolved
Reason: Focal duplicate-requirement failures were fixed by the pip hotfixes in PR #1211, commit 5d9bf14d, released in Charmcraft 2.4.1. The reporter later confirmed that 2.4.1 resolved the requirements.txt and charm-lib PYDEPS conflict.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
When a dependency is added to both the charm's requirements.txt and a charm lib's PYDEPS, packing will fail on focal base but succeed no jammy base.
### To Reproduce
Add a charm library with a PYDEPS dependency
Add the dependency to the charm's requirements.txt
Pack the charm on focal
### Environment
Ubuntu 20.04
### charmcraft.yaml
```shell
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
type: charm
bases:
- build-on:
- name: "ubuntu"
channel: "20.04"
run-on:
- name: "ubuntu"
channel: "20.04"
- build-on:
- name: "ubuntu"
channel: "22.04"
run-on:
- name: "ubuntu"
channel: "22.04"
parts:
charm:
charm-binary-python-packages:
- psycopg2-binary==2.9.6 # renovate
- psycopg[binary]==3.1.9 # renovate
```
### Relevant log output
```shell
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:54.991 :: Running external command ['/root/parts/charm/build/staging-venv/bin/pip3', 'install', '--upgrade', '--no-binary', ':all:
', '--requirement=requirements.txt', 'cosl', 'ops>=2.0.0', 'pydantic<2']
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.083 :: :: ERROR: Double requirement given: cosl==0.0.5 (from -r requirements.txt (line 1)) (already in cosl, name='cosl')
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.123 :: Traceback (most recent call last):
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.123 :: File "/snap/charmcraft/1429/lib/charmcraft/charm_builder.py", line 432, in <module>
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.123 :: main()
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: File "/snap/charmcraft/1429/lib/charmcraft/charm_builder.py", line 427, in main
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: builder.build_charm()
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: File "/snap/charmcraft/1429/lib/charmcraft/charm_builder.py", line 102, in build_charm
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: self.handle_dependencies()
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: File "/snap/charmcraft/1429/lib/charmcraft/charm_builder.py", line 314, in handle_dependencies
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: self._install_dependencies(staging_venv_dir)
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: File "/snap/charmcraft/1429/lib/charmcraft/instrum.py", line 152, in _f
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: return func(*args, **kwargs)
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: File "/snap/charmcraft/1429/lib/charmcraft/charm_builder.py", line 274, in _install_dependencies
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: _process_run(cmd)
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: File "/snap/charmcraft/1429/lib/charmcraft/charm_builder.py", line 368, in _process_run
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: raise RuntimeError(f"Subprocess command {cmd} execution failed with retcode {retcode}")
2023-07-26 13:43:56.588 :: 2023-07-26 10:43:56.124 :: RuntimeError: Subprocess command ['/root/parts/charm/build/staging-venv/bin/pip3', 'install', '--upgrade', '--no-binary', ':all:', '--requirement=requirements.txt', 'cosl', 'ops>=2.0.0', 'pydantic<2'] execution failed with retcode 1
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Resolved in Charmcraft 2.4.1 via pip hotfixes merged in PR #1211 (commit 5d9bf14d); the reporter confirmed packing now works on Focal. | |
| stealth/space-bunny-alpha | — | closed resolved | Duplicate requirements on Focal were resolved in Charmcraft 2.4.1. The reporter confirmed the release worked; its hotfixes were merged in commit 5d9bf14d (#1211). | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in charmcraft 2.4.1. The focal packing failure from duplicate dependencies in requirements.txt and PYDEPS was resolved by updating pip handling, aligning behavior across Ubuntu 20.04 and 22.04. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in charmcraft 2.4.1. The focal packing failure caused by duplicate dependencies in requirements.txt and PYDEPS was resolved by updating pip dependency handling, as confirmed by the reporter. | |
| qwen/qwen3.6-35b-a3b | — | — | Duplicate dependencies in requirements.txt and PYDEPS cause packing failures on Ubuntu 20.04 due to pip version differences. The bug was fixed in charmcraft 2.4.1. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved in charmcraft 2.4.1. The focal packing failure from duplicate requirements.txt and PYDEPS entries was fixed, addressing the pip version discrepancy between focal and jammy. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
charmcraft#1211
(confidence 99%)
PR #1211 merged the hotfixes in commit 5d9bf14d, providing the pip update used in the successful 2.4.1 release.
Related issues
No related issues found above the similarity threshold.