← 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

Machine-profile init used Ubuntu 22.04 and lacked clear uv-lock guidance. The current implementation defaults machine to 24.04 and supplies uv/migration instructions, so the reported template concerns appear addressed.

Suggested action: close resolved

Reason: Maintainer comments establish that the uv plugin packages the locked environment from uv.lock, so editing pyproject.toml without running uv lock explains the reported dependency omission. The current init code maps machine to ubuntu@24.04 and its success message tells users to run uv lock and links the migration guide; commit 3f641e46 (PR #2506) and profile work in 0be5a5e7 (PR #2754) are present.

Evaluated by: mr-cal-bot

Impact: 48 Quick Win: 26 Complexity: 38 Confidence: 90 Actionability: 88

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
stealth/space-bunny-alpha
Impact: 48
Quick Win: 26
Complexity: 38
Confidence: 90
Actionability: 88
close resolved Machine-profile init used Ubuntu 22.04 and lacked clear uv-lock guidance. The current implementation defaults machine to 24.04 and supplies uv/migration instructions, so the reported template concerns appear addressed.
qwen/qwen3.6-35b-a3b
Impact: 35
Quick Win: 21
Complexity: 25
Confidence: 85
Actionability: 80
keep open Tracks confusion with charmcraft init templates ignoring pyproject.toml dependencies and using 22.04 base. Maintainers acknowledge the onboarding friction, opened PR #2506 to improve docs, and plan to bump the base to 24.04.
qwen/qwen3.8-27b
Impact: 55
Quick Win: 38
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.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/charmcraft#2506 (confidence 98%)

    Commit 3f641e46 adds uv and migration guidance to the init output, addressing the template usability concern.

  • Likely Fixed By: canonical/charmcraft#2754 (confidence 88%)

    Commit 0be5a5e7 updates profile dependency handling and init output.

  • Related To: canonical/charmcraft#2873 (confidence 80%)

    Current init base mapping uses ubuntu@24.04 for machine, while commit 3eb45f3a adds base-specific profile support.

Related issues

Issue Project State Summary Similarity
#2167 charmcraft init --profile machine does not produce a valid charmcraft.yaml charmcraft closed Fixed by #2200 (commit c4d43add), which migrated the machine init template from legacy bases syntax to platforms.
73%
#328 charmcraft init produces error charm for machine charms charmcraft closed Machine charms gained a dedicated charmcraft init profile, resolving Kubernetes-only initialization; the change was merged in PR #868 (commit 2ed9033c).
72%