← Back to issue list

`--bases-index` ignored on charmcraft 3

View original Github issue

Metadata

Project
charmcraft
Number
#1983
Type
issue
State
open
Author
carlcsaposs-canonical
Labels
—
Created
Updated
Closed
—

Current evaluation

`--bases-index 1` is accepted but Charmcraft 3.2.1 still builds bases 0 and 1; the precise report has no maintainer triage or confirmed resolution.

Suggested action: needs triage

Reason: The report supplies an exact project commit, manifest, command, environment, and output showing both base 0 and base 1 packed. There are no labels, maintainer comments, or resolving references; current code still registers `--bases-index`, but its validation method has no visible call and `PackCommand._run` contains no filtering logic.

Evaluated by: mr-cal-bot

Impact: 46 Quick Win: 24 Complexity: 38 Confidence: 81 Actionability: 84

Issue body

### Bug Description `charmcraft pack` with `--bases-index` packs all bases For example, using `charmcraft pack --bases-index 1` with a charmcraft.yaml bases that looks like ```yaml bases: - name: ubuntu channel: "20.04" architectures: [amd64] - name: ubuntu channel: "22.04" architectures: [amd64] - name: ubuntu channel: "22.04" architectures: [arm64] ``` packs base 0 and base 1 instead of just base 1 Only occurs on charmcraft 3, not charmcraft 2 ### To Reproduce ``` lxd init --auto sudo snap install charmcraft --classic git clone https://github.com/canonical/mysql-router-operator cd mysql-router-operator/ git checkout 60ad0549c590d48d77d37f83fe8d105f5a182d4a charmcraft pack -v --bases-index 1 ``` Output shows ``` Launching managed ubuntu 20.04 instance... [...] Packing charm mysql-router_ubuntu-20.04-amd64.charm Packed mysql-router_ubuntu-20.04-amd64.charm Launching managed ubuntu 22.04 instance... [...] Packing charm mysql-router_ubuntu-22.04-amd64.charm Packed mysql-router_ubuntu-22.04-amd64.charm ``` ### Environment Ubuntu 22.04.1 LTS ``` $ snap list Name Version Rev Tracking Publisher Notes charmcraft 3.2.1 4914 latest/stable canonical✓ classic core18 20221027 2620 latest/stable canonical✓ base core20 20221027 1695 latest/stable canonical✓ base core22 20241001 1663 latest/stable canonical✓ base lxd 5.0.1-9dcf35b 23541 5.0/stable/… canonical✓ - snapd 2.57.5 17576 latest/stable canonical✓ snapd ``` ### charmcraft.yaml ```yaml # Copyright 2022 Canonical Ltd. # See LICENSE file for licensing details. type: charm bases: # Whenever "bases" is changed: # - Update tests/conftest.py::pytest_configure() # - Update .github/workflow/ci.yaml integration-test matrix - name: ubuntu channel: "20.04" architectures: [amd64] - name: ubuntu channel: "22.04" architectures: [amd64] - name: ubuntu channel: "22.04" architectures: [arm64] parts: files: plugin: dump source: . build-packages: - git override-build: | # Workaround to add unique identifier (git hash) to charm version while specification # DA053 - Charm versioning # (https://docs.google.com/document/d/1Jv1jhWLl8ejK3iJn7Q3VbCIM9GIhp8926bgXpdtx-Sg/edit?pli=1) # is pending review. python3 -c 'import pathlib; import shutil; import subprocess; git_hash=subprocess.run(["git", "describe", "--always", "--dirty"], capture_output=True, check=True, encoding="utf-8").stdout; file = pathlib.Path("charm_version"); shutil.copy(file, pathlib.Path("charm_version.backup")); version = file.read_text().strip(); file.write_text(f"{version}+{git_hash}")' craftctl default stage: # Exclude requirements.txt file during staging # Workaround for https://github.com/canonical/charmcraft/issues/1389 on charmcraft 2 - -requirements.txt prime: - charm_version - workload_version charm: build-snaps: - rustup build-packages: - libffi-dev - libssl-dev - pkg-config override-build: | rustup default stable # Convert subset of poetry.lock to requirements.txt curl -sSL https://install.python-poetry.org | python3 - /root/.local/bin/poetry export --only main,charm-libs --output requirements.txt craftctl default stage: # Exclude charm_version file during staging - -charm_version # TODO: enable after https://github.com/canonical/charmcraft/issues/1456 fixed charm-strict-dependencies: false charm-requirements: [requirements.txt] charm-entrypoint: src/machine_charm.py ``` ### Relevant log output [charmcraft_output.txt](https://github.com/user-attachments/files/17679837/charmcraft_output.txt) [charmcraft-20241108-113122.844623.log](https://github.com/user-attachments/files/17679838/charmcraft-20241108-113122.844623.log)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 46
Quick Win: 24
Complexity: 38
Confidence: 81
Actionability: 84
needs triage `--bases-index 1` is accepted but Charmcraft 3.2.1 still builds bases 0 and 1; the precise report has no maintainer triage or confirmed resolution.
qwen/qwen3.6-35b-a3b
Impact: 75
Quick Win: 45
Complexity: 30
Confidence: 80
Actionability: 85
keep open charmcraft 3 ignores --bases-index flag during pack, building all bases instead of the specified one. Regression from charmcraft 2.
qwen/qwen3.8-27b
Impact: 55
Quick Win: 33
Staleness: 70
Complexity: 40
Confidence: 70
Support Request: 5
needs triage charmcraft 3 pack ignores --bases-index, building all bases instead of the requested one. Reported on 3.2.1; no maintainer response, only a Jira sync bot comment. Option still exists in code but appears unused in the pack run path.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 35
Confidence: 85
Support Request: 5
needs triage charmcraft pack --bases-index flag ignored in v3, packing all bases instead of the specified one. Open since ~1.5 years with no maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 40
Confidence: 80
Support Request: 5
needs triage Needs maintainer assessment. Reports --bases-index flag ignored in charmcraft 3, packing all bases instead of the specified one. Clear reproduction steps provided, but no maintainer response or labels in over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 45
Confidence: 80
Support Request: 5
needs triage Regression in charmcraft 3 where --bases-index is ignored during pack, building all bases instead of the specified one. Unlabelled with no maintainer response in over a year.

Update history

No update history recorded yet.

Related work

  • Caused By: canonical/charmcraft#1704 (confidence 74%)

    The craft-application pack-command migration is the likely point where bases-index handling became disconnected from execution.

Related issues

Issue Project State Summary Similarity
#1783 Charmcraft 3 no longer respects legacy bases architectures charmcraft closed Fixed in Charmcraft 3.1.2 by merged PR #1795 (8b16cae4), which limits manifest.yaml bases to those in the current build, preserving arm64 metadata.
71%