← Back to issue list

Add `--force` option to `charmcraft fetch-lib`

View original Github issue

Metadata

Project
charmcraft
Number
#806
Type
issue
State
closed
Author
dstathis
Labels
—
Created
Updated
Closed

Current evaluation

--force was not added; merged PR #1665 introduced fetch-libs, which updates declared libraries despite local modifications.

Resolution: closed superseded

Reason: The request was superseded by the fetch-libs workflow added in PR #1665, commit 38ea17d6, and released in Charmcraft 3.1.0. The maintainer's closing comment directs users to declare charm-libs and run fetch-libs.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Currently, if you try to run `fetch-lib` while you have local modifications to the library, charmcraft will fail with eg: `Library charms.loki_k8s.v0.loki_push_api has local changes, cannot be updated.` It would be nice if you could overwrite the library discarding the local changes.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed superseded --force was not added; merged PR #1665 introduced fetch-libs, which updates declared libraries despite local modifications.
stealth/space-bunny-alpha — closed resolved --force was not added; merged PR #1665 introduced fetch-libs, which updates declared libraries despite local modifications.
qwen3.6-35b-a3b-mtp-q6 — — The --force flag was not implemented. Local library overwrites are now handled automatically when charmlibs are defined in charmcraft.yaml and the fetch-libs command is used.
qwen/qwen3.6-35b-a3b — — Closed as superseded. The --force flag is unnecessary because defining charmlibs in charmcraft.yaml and using fetch-libs now correctly overwrites local library changes, resolving the original request.
qwen3.6-35b-a3b-mtp-q6 — — Closed without adding a --force flag. The behavior is now handled by defining charmlibs in charmcraft.yaml and using the fetch-libs command, which correctly manages local changes.

Update history

No update history recorded yet.

Related work

  • Superseded By: canonical/charmcraft#1665 (confidence 99%)

    Added fetch-libs for automatic fetching and updating of libraries declared in charmcraft.yaml.

Related issues

Issue Project State Summary Similarity
#1665 feat: add fetch-libs command charmcraft merged Merged PR #1665 added Charmcraft's fetch-libs command; implementation landed in commit 38ea17d6.
76%
#200 Add force option to charmcraft init charmcraft merged Merged in canonical/charmcraft#200 via 580773c4, adding --force to charmcraft init so it can initialize non-empty directories without overwriting files.
73%
#1663 refactor: remove unused fetch-lib command charmcraft merged PR #1663 (commit b3d35e6d) merged, deleting the unused pre-craft-application fetch-lib implementation; the public fetch-lib command was kept and #1665 added fetch-libs for charmcraft.yaml-declared libraries.
72%
#1671 `fetch-libs` command requires being logged into charmhub charmcraft closed Fixed by merged PR #1702 (commit 1da46c8f), which made fetch-libs use anonymous Charmhub access. PR #1701 also fixed handling of library names containing underscores.
71%