Charmcraft confuses the current directory with the project directory when both has a charmcraft.yaml
Metadata
Current evaluation
Charmcraft 4.2.1 mixed the CWD and -p project files when both had charmcraft.yaml, breaking nested pack builds and CI; targeted project-directory fixes are present in current code.
Suggested action: close resolved
Reason: The current Charmcraft._run_inner code reads the requested -p directory, updates the project service, and evicts a service cached with the CWD; commit 5e634d96 (PR #2600) explicitly fixes -p and -o handling. Commit c87eca0d (PR #2644) also fixes metadata lookup from the selected project directory, directly covering the reported path mixing.
Evaluated by: mr-cal-bot
Issue body
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
58
Quick Win:
23
Complexity:
52
Confidence:
84
Actionability:
84
|
close resolved | Charmcraft 4.2.1 mixed the CWD and -p project files when both had charmcraft.yaml, breaking nested pack builds and CI; targeted project-directory fixes are present in current code. | |
| stealth/space-bunny-alpha |
Impact:
57
Quick Win:
25
Complexity:
48
Confidence:
84
Actionability:
85
|
needs triage | Charmcraft 4.2.1 regression: `pack -p` fails when the working directory and selected project directory both contain charmcraft.yaml, potentially breaking CI builds. | |
| qwen3.6-35b-a3b-mtp-q6 |
Impact:
50
Quick Win:
25
Staleness:
65
Complexity:
50
Confidence:
60
Support Request:
10
|
needs triage | Regression in charmcraft 4.2.1 where 'charmcraft pack -p' fails if both CWD and project directory contain charmcraft.yaml. Untriaged, 101 days old. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
65
Complexity:
35
Confidence:
90
Support Request:
5
|
needs triage | Bug where charmcraft pack fails when both current and target directories contain charmcraft.yaml. Regression from v4.0.1 to v4.2.1. Untriaged, no maintainer comments. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
65
Complexity:
45
Confidence:
90
Support Request:
10
|
needs triage | charmcraft pack -p fails when both current and target directories contain charmcraft.yaml. Regression from v4.0.1 to v4.2.1. Untriaged, no maintainer response. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#2600
(confidence 93%)
Commit 5e634d96 changes -p/-o handling and removes the project service cached with the CWD.
-
Related To:
canonical/charmcraft#2644
(confidence 88%)
Merged commit c87eca0d fixes metadata lookup using the selected project directory; the PR is documented as resolving #2493.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #434 Output path changed with charmcraft 1.1.0 | charmcraft | closed | Charmcraft’s 1.1.0 pack regression was fixed, again writing the packed charm to the current working directory rather than the --project-dir directory. | |
| #2854 charmcraft pack ignores -o option in version 4.4.1 | charmcraft | open | charmcraft 4.4.1 `pack -o .` does not place the charm in the -o folder when --project-dir points outside cwd. Exact repro given, but reported output location unspecified. Unlabelled, no maintainer response in 36 days. | |
| #2498 fix: `charmcraft pack --project-dir` with metadata.yaml | charmcraft | closed | Closed unmerged; superseded by #2644, which fixed metadata lookup for --project-dir and shipped in Charmcraft 4.2.1. | |
| #514 `charmcraft build` silently omits files called out in `charmcraft.yaml` if executed from an external directory | charmcraft | closed | Fixed by merged PR canonical/charmcraft#525 (merge commit 0d78f540), which runs the parts lifecycle from the project directory so relative globbed paths resolve during external builds. | |
| #433 charmcraft --project-dir does not work for build anymore | charmcraft | closed | Closed as working as designed: maintainer facundobatista explained `build` selects its project dir with `--from`, not `--project-dir` (which `pack` uses), so `charmcraft build --from charm-slurmd/` works. | |
| #198 `charmcraft init` would be better off with explicit directory name | charmcraft | closed | Kept directory selection on --project-dir; missing directories are now created by #508 (commit 15d530ae). | |
| #1149 command: charmcraft init to use charmcraft.yaml only | charmcraft | merged | Merged in ca4df024: charmcraft init now generates a unified charmcraft.yaml containing metadata, actions, and config, with profile descriptions and an updated URL. |