← Back to issue list

`create-lib` command breaks without a metadata.yaml file

View original Github issue

Metadata

Project
charmcraft
Number
#1227
Type
issue
State
closed
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Fixed by merged PR #1228 (commit cf6c8526), which made `create-lib` fall back to charmcraft.yaml for the charm name instead of requiring metadata.yaml.

Resolution: closed resolved

Reason: Commit cf6c8526 "commands(store): make create-lib work without a metadata.yaml file (#1228)" changed the create-lib command to source the charm name from charmcraft.yaml, removing the "Cannot find a valid charm name in metadata.yaml" failure.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description Without a `metadata.yaml` file, `charmcraft create-lib` fails. However, it only needs this to get the charm name. ### To Reproduce `charmcraft init` (or with any explicit profile) `charmcraft create-lib mylib` ### Environment N/A ### charmcraft.yaml ```shell N/A ``` ### Relevant log output ```shell (charmcraft) lengau@hyperion:~/Work/Test/charms/tmp$ charmcraft init --profile=kubernetes Charmed operator package file and directory tree initialised. Now edit the following package files to provide fundamental charm metadata and other information: charmcraft.yaml src/charm.py README.md (charmcraft) lengau@hyperion:~/Work/Test/charms/tmp$ charmcraft create-lib mylib Cannot find a valid charm name in metadata.yaml. Check you are in a charm directory with metadata.yaml. Full execution log: '/home/lengau/.local/state/charmcraft/log/charmcraft-20230818-165535.506311.log' ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #1228 (commit cf6c8526), which made `create-lib` fall back to charmcraft.yaml for the charm name instead of requiring metadata.yaml.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #1228 (commit cf6c8526), allowing create-lib to work without metadata.yaml by using charmcraft.yaml for the charm name.
qwen3.6-35b-a3b-mtp-q6 — — Closed without resolution. The create-lib command fails without metadata.yaml. Maintainer noted this breaks store tests and suggested adding spread tests that do not rely on the store.
qwen/qwen3.6-35b-a3b — — Fixed. Updated charmcraft create-lib to extract the charm name from charmcraft.yaml instead of requiring metadata.yaml, resolving associated test failures.
qwen/qwen3.6-35b-a3b — — Closed without a documented fix. The maintainer noted the bug causes libraries and libraries-update store test failures and recommended adding spread tests that do not rely on the store.
qwen3.6-35b-a3b-mtp-q6 — — Closed without resolution. The create-lib failure was not fixed and no pull request was linked. The maintainer suggested alternative testing instead of a fix, indicating abandonment.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/charmcraft#1228 (confidence 97%)

    PR #1228 resolved the issue in commit cf6c8526.

  • Related To: canonical/charmcraft#1234 (confidence 72%)

    Companion change (commit 2f184582) applying the same metadata.yaml-free approach to `publish-lib`.

Related issues

Issue Project State Summary Similarity
#1228 commands(store): make create-lib work without a metadata.yaml file charmcraft merged Merged #1228 (commit cf6c8526) fixed #1227 by allowing create-lib to use charmcraft.yaml when metadata.yaml is absent; it also advanced #1193.
84%
#1973 `charmcraft list-lib` does not work without a `metadata.yaml` file charmcraft closed charmcraft list-lib required metadata.yaml for the charm name. Fixed by merged PR #1974 (commit beb5c145), making list-lib read the name from charmcraft.yaml; tracked internally as CRAFT-3695.
80%
#1234 store: allow publish-lib to work without a metadata.yaml charmcraft merged Merged #1234 as 2f184582: charmcraft's store publish-lib now works without metadata.yaml; the prerequisite resource-test fix landed in #1223.
70%