← Back to issue list

'charm-strict-dependencies' requires at least one requirements file. in field 'parts.charm.charm-strict-dependencies'

View original Github issue

Metadata

Project
charmcraft
Number
#1389
Type
issue
State
closed
Author
carlcsaposs-canonical
Labels
—
Created
Updated
Closed

Current evaluation

Merged #1808 (0d3b2713) to remove early requirements-file existence checks, although the reporter said explicitly listed files still failed in Charmcraft 2.7.3.

Resolution: closed resolved

Reason: PR #1808 was merged as commit 0d3b2713 to defer checking explicitly listed requirements files until the relevant build step runs.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description I'm guessing `charm-strict-dependencies` defaults to requirements.txt during charmcraft pack? Looks like the same default doesn't apply to `charmcraft clean` ### To Reproduce charmcraft installed from edge (rev 1824 2.5.0.post16+git23bf390) 1. clone https://github.com/canonical/mysql-router-k8s-operator 2. charmcraft pack 3. charmcraft clean ``` Bad charmcraft.yaml content: - 'charm-strict-dependencies' requires at least one requirements file. in field 'parts.charm.charm-strict-dependencies' Full execution log: '/home/ubuntu/.local/state/charmcraft/log/charmcraft-20231124-090230.749172.log' ``` ### Environment Ubuntu 22.04 ### 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 charm-strict-dependencies: true build-packages: - libffi-dev - libssl-dev - pkg-config - rustc - cargo ``` ### Relevant log output [charmcraft-20231124-090230.749172.log](https://github.com/canonical/charmcraft/files/13457115/charmcraft-20231124-090230.749172.log) [charmcraft-20231124-084822.286563.log](https://github.com/canonical/charmcraft/files/13457116/charmcraft-20231124-084822.286563.log)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged #1808 (0d3b2713) to remove early requirements-file existence checks, although the reporter said explicitly listed files still failed in Charmcraft 2.7.3.
stealth/space-bunny-alpha — closed superseded Charmcraft#1808 merged as 0d3b2713, removing early requirements-file existence checks, but the reporter confirmed the error persisted in 2.7.3.
qwen3.6-35b-a3b-mtp-q6 — — Closed without a confirmed fix. Maintainer referenced PR #1808 and suggested a workaround, but the author confirmed the validation error persists in v2.7.3. The issue remains unresolved.
qwen/qwen3.6-35b-a3b — — Closed despite author confirming the bug persists in v2.7.3. Maintainer referenced PR #1808 and a workaround, but validation still fails for clean and upload commands without an explicit requirements file. Unresolved.
qwen/qwen3.6-35b-a3b — — Closed without resolution. Maintainer cited PR #1808 as a fix, but the reporter confirmed the validation error persists in charmcraft 2.7.3 for pack and version commands. The issue remains unfixed.
qwen3.6-35b-a3b-mtp-q6 — — Closed without resolution. A maintainer referenced PR #1808 as a fix, but the author confirmed the validation error persists in charmcraft v2.7.3 despite workarounds.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/charmcraft#1808 (confidence 99%)

    Merged change removing the early requirements-file existence checks.

Related issues

Issue Project State Summary Similarity
#1456 Strict dependencies prevents charm from building charmcraft closed Fixed in PR #1716 (commit def89c50): Charmcraft raised its minimum pip version so strict-dependency builds upgrade old virtual environments first.
74%
#470 [REGRESSION] charmcraft not installing dependencies from requirements.txt anymore charmcraft closed Fixed by merged PR #472 (commit 57b74577, "build: include venv in prime if charm-requirements defined"), which restored requirements.txt deps appearing in packed charms; maintainer closed after release in edge.
74%
#657 Enforce deprecation DN05: Use charm-requirements in charmcraft.yaml parts to define requirements charmcraft closed DN05 was enforced by merged PR #797 (commit 63d57d8c), removing the legacy --requirements option from build and pack.
70%