← Back to issue list

Allow `charmcraft pack` override build series upon command line parameters

View original Github issue

Metadata

Project
charmcraft
Number
#936
Type
issue
State
closed
Author
paulomach
Labels
—
Created
Updated
Closed

Current evaluation

Closed without code changes: maintainer pointed to the existing `charmcraft pack --bases-index=1` (added in PR #392) which already covers the use case; the author confirmed it solved the request.

Resolution: closed not a bug

Reason: facundobatista explained that `pack --bases-index` already selects a single entry from `bases` in charmcraft.yaml, and paulomach confirmed it fully met the need. The option remains implemented in charmcraft/application/commands/lifecycle.py with index validation.

Evaluated by: mr-cal-bot

No scores available.

Issue body

## Proposal Add `--build-on` and `--run-on` command line parameters to `charmcraft pack` that would override these parameters from `charmcraft.yaml` file. ## Use case This can potentially decrease setup times on charm CI when testing for a specific series, but the charm support more than one series, e.g., `charmcraft.yaml` is: ```yaml bases: - build-on: - name: "ubuntu" channel: "20.04" run-on: - name: "ubuntu" channel: "20.04" - build-on: - name: "ubuntu" channel: "22.04" run-on: - name: "ubuntu" channel: "22.04" ``` But CI test will matrix run only on jammy, passing the proposed arguments would avoid building the charm for focal, saving some time of the process, e.g.: ```shell $ charmcraft pack --build-on=ubuntu:22.04 --run-on=ubuntu:22.04 ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug Closed without code changes: maintainer pointed to the existing `charmcraft pack --bases-index=1` (added in PR #392) which already covers the use case; the author confirmed it solved the request.
stealth/space-bunny-alpha — closed not a bug Feature request closed as already covered: `charmcraft pack --bases-index=1` (added in PR #392) selects a single base, and the author confirmed it solves the need. Docs clarified in PR #942.
stealth/space-bunny-alpha — closed not a bug Feature request closed with no code change: maintainer facundobatista pointed out existing `charmcraft pack --bases-index=1` already covers the CI use case, and reporter paulomach confirmed it solved the need.
stealth/space-bunny-alpha — closed not a bug No code change was needed: charmcraft pack already supports selecting one base with --bases-index, and the author confirmed it met the request.
qwen3.6-35b-a3b-mtp-q6 — — Closed as a duplicate. The requested CLI override for build series is already supported via the --bases-index flag in charmcraft pack. Author acknowledged the existing functionality and thanked the maintainer.
qwen/qwen3.6-35b-a3b — — The feature request to add CLI overrides for build series was resolved by pointing the author to the existing --bases-index option, which already fulfills the use case. The issue was closed as the proposed solution was sufficient.
qwen3.6-35b-a3b-mtp-q6 — — Superseded by existing functionality. The --bases-index option already allows overriding build series from charmcraft.yaml, making the proposed CLI flags unnecessary. The author acknowledged the oversight, and the issue was closed.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#392 (confidence 90%)

    Merged PR that introduced --bases-index (commit 6e58852f), the feature cited as already solving the request; no new PR was made for #936.

  • Related To: canonical/charmcraft#942 (confidence 55%)

    Doc-only change (commit c5d825f7) clarifying that --bases-index is zero-based, aligning with the suggested fix.

Related issues

Issue Project State Summary Similarity
#411 build: pack charm in provided environment when using bases (CRAFT-313) charmcraft merged Merged PR #411 (CRAFT-313) to pack each viable bases configuration in its provided build environment; merge commit 523c6fb0.
72%