← Back to issue list

charmcraft pack wont produce a proper charm

View original Github issue

Metadata

Project
charmcraft
Number
#2494
Type
issue
State
open
Author
erik78se
Labels
Created
Updated
Closed

Current evaluation

charmcraft init machine profile produced 22.04 base and ignored pyproject.toml deps (uv.lock needed). Base bumped to 24.04 in #2522; init output now explains uv lock in #2754. Docs/template improvements still open.

Suggested action: keep open

Reason: Maintainers actively engaged (lengau confirmed 22.04 was forgotten, dwilding opened PR #2506). Base bump landed in #2522 and init output improved in #2754, but the reporter's request for better template docs/links and tests is not fully addressed, so the issue remains valid and open.

Impact: 55 Quick Win: 38.5 Staleness: 25 Complexity: 30 Confidence: 75 Support Request: 40

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description **When:** Creating a default machine charm with charmcraft init. ``` mkdir foobar charmcraft init --profile machine vi pyproject.toml # modify the dependencies charmcraft pack unzip -l foobar_amd64.charm # The dependencies has not been included as expected ``` **Expected 1:** A charm that builds a machine charm and respects the dependencies in pyproject.toml for added python libs. **Expected 2:** The charm builds for 24.04 since this would be something reasonable. **What I did:** I added a library to the pyproject.toml dependencies. **What happened:** The built charm was built for a 22.04 (very old) **What happened:** The built charm ignored the pyproject.toml What I would like to see: The charmcraft init --profile machine should behave properly and respect the pyproject.toml (and be 24.04) ### Steps to reproduce ``` mkdir foobar charmcraft init --profile machine vi pyproject.toml # modify the dependencies charmcraft pack unzip -l foobar_amd64.charm # The dependencies has not been included as expected ``` ### Environment charmcraft 4.0.1 ### charmcraft.yaml ```yaml type: charm name: foobar title: Charm Template summary: A very short one-line summary of the charm. description: | test base: ubuntu@22.04 platforms: amd64: parts: charm: plugin: uv source: . build-snaps: - astral-uv ``` ### Log output ```shell ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 55
Quick Win: 38.5
Staleness: 25
Complexity: 30
Confidence: 75
Support Request: 40
keep open charmcraft init machine profile produced 22.04 base and ignored pyproject.toml deps (uv.lock needed). Base bumped to 24.04 in #2522; init output now explains uv lock in #2754. Docs/template improvements still open.
qwen/qwen3.6-35b-a3b
Staleness: 20
Complexity: 15
Confidence: 90
Support Request: 80
keep open User reports charmcraft init/pack ignores pyproject.toml dependencies and defaults to 22.04. Maintainers explain uv plugin requires uv.lock, acknowledge confusing templates, and are updating docs via PR #2506.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 15
Confidence: 85
Support Request: 40
keep open User reported charmcraft pack ignoring dependencies and using old base. Maintainers clarified uv plugin requires uv.lock, acknowledged template/docs gaps, and opened PR #2506 to improve documentation and update base to 24.04.
qwen3.6-35b-a3b-mtp-q6
Staleness: 35
Complexity: 25
Confidence: 85
Support Request: 20
keep open User reports charmcraft init template ignores pyproject.toml dependencies and uses outdated 22.04 base. Maintainers acknowledge the issue, opened a PR to improve documentation, and plan to update templates and bump the base to 24.04.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 20
Confidence: 85
Support Request: 70
keep open Default charm templates confuse users with uv dependency management and an outdated 22.04 base. Documentation updates are tracked in PR #2506, while upgrading the base to 24.04 is acknowledged but not yet implemented.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: charmcraft#2522 (confidence 85%)

    Commit f05c9156 'feat(templates): use base 24.04 for kubernetes and machine profiles' addresses the 22.04 base complaint.

  • Related To: charmcraft#2754 (confidence 70%)

    Commit 0be5a5e7 'feat(profiles): bound dependencies, remove uv.lock files, improve init output' addresses the confusing dependency management.

  • Related To: charmcraft#2506 (confidence 60%)

    PR opened by dwilding to mention uv and include migration docs link in init output.

Related issues

Issue Project State Summary Similarity
#328 charmcraft init produces error charm for machine charms charmcraft closed Closed without resolution. Maintainers acknowledged the core issue persists: charmcraft init still lacks a machine charm template or flag, leaving machine charm workflows unsupported despite claims that metadata changes fixed it.
73%
#2167 charmcraft init --profile machine does not produce a valid charmcraft.yaml charmcraft closed Closed and converted to a feature request. The machine profile template uses the legacy bases key, causing validation failures on newer versions. Resolution involves updating templates to use the platforms key.
72%