Unable to build multi-base subordinate charms on 24.04
Metadata
Current evaluation
Multi-base builds were implemented with platforms-based recipes in merged PR #2054 (commit 1ad02d82), enabling one recipe to build charms for multiple Ubuntu bases.
Resolution: closed resolved
Reason: The capability landed in merged PR #2054 at commit 1ad02d82, introducing platforms-based recipes for multiple bases. This implemented the requested single-recipe multi-base workflow.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
Subordinate charms use the base of the principal charm. Therefore, subordinate charms such as MySQL Router need to support multiple bases, since we can't enforce the principal charm to use a particular base. Currently MySQL Router supports 20.04 and 22.04 and plans to support 24.04.
However, with the new `base` and `platforms` syntax in charmcraft 3, it is not possible to build a subordinate charm on 20.04, 22.04, and 24.04 with a single charmcraft.yaml and git branch
Additional context:
I believe @jnsgruk and @sergiusens were/are discussing this. Created an issue to track officially per @taurus-forever's request
### To Reproduce
1. Create charmcraft.yaml with
```yaml
bases:
- name: ubuntu
channel: "20.04"
architectures: [amd64]
- name: ubuntu
channel: "22.04"
architectures: [amd64]
- name: ubuntu
channel: "22.04"
architectures: [arm64]
- name: ubuntu
channel: "24.04"
architectures: [amd64]
- name: ubuntu
channel: "24.04"
architectures: [arm64]
```
2. charmcraft pack
### Environment
Ubuntu 22.04
### charmcraft.yaml
```shell
# 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]
- name: ubuntu
channel: "24.04"
architectures: [amd64]
- name: ubuntu
channel: "24.04"
architectures: [arm64]
parts:
charm:
override-pull: |
craftctl default
if [[ ! -f requirements.txt ]]
then
echo 'ERROR: Use "tox run -e build-dev" instead of calling "charmcraft pack" directly' >&2
exit 1
fi
# TODO: enable after https://github.com/canonical/charmcraft/issues/1456 fixed
charm-strict-dependencies: false
charm-entrypoint: src/machine_charm.py
prime:
- charm_version
- workload_version
build-packages:
- libffi-dev
- libssl-dev
- pkg-config
- rustc
- cargo
```
### Relevant log output
```shell
Bad charmcraft.yaml content:
- base requires 'platforms' definition: {'name': 'ubuntu', 'channel': '24.04', 'architectures': ['amd64']} (in field 'bases[3]')
- base requires 'platforms' definition: {'name': 'ubuntu', 'channel': '24.04', 'architectures': ['arm64']} (in field 'bases[4]')
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Multi-base builds were implemented with platforms-based recipes in merged PR #2054 (commit 1ad02d82), enabling one recipe to build charms for multiple Ubuntu bases. | |
| stealth/space-bunny-alpha | — | closed resolved | Multi-base charm builds were added by merged charmcraft#2054 (commit 1ad02d82), introducing platforms-based recipes to support builds for multiple Ubuntu bases. | |
| stealth/space-bunny-alpha | — | closed resolved | Multi-base recipe support was merged in canonical/charmcraft#2054 (commit 1ad02d82), resolving the inability to build for Ubuntu 20.04, 22.04, and 24.04 from one branch. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Reported build failures for multi-base subordinate charms under charmcraft 3's new syntax. Closed after a user identified PR #2054 as the resolution for configuring multiple bases. | |
| qwen/qwen3.6-35b-a3b | — | — | Superseded after the reporter found PR #2054, which implemented the required platforms syntax for multi-base builds. The original configuration error was resolved by the updated charmcraft structure. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by merging PR #2054 and updating charmcraft syntax. The new platforms and build-on/run-on fields now support multi-base subordinate charms. Documentation was updated to clarify configuration and address code duplication concerns. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed and superseded by PR #2054, which resolves the multi-base subordinate charm build failure. The PR implements support for the updated charmcraft.yaml syntax, allowing multiple bases and platforms to be configured without validation errors. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#2054
(confidence 100%)
Merged as commit 1ad02d82, adding multi-base platform recipe support.
-
Related To:
charmcraft#2008
(confidence 95%)
Tracked the same multi-base platform capability and was also resolved by #2054.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2008 Multi-base platform support | charmcraft | closed | Multi-base support shipped in charmcraft#2054 (commit 1ad02d82) via platforms-based recipes; the prototype was not separately polished, but the requested capability was implemented. | |
| #73 Add multi-bases support for charm build plans | craft-platforms | closed | Multi-base charm build-plan support was merged in PR #81 (commit 519b705), with validation tightening and error-handling updates; it resolved #73. | |
| #861 No support for paralell builds for multi-base charms | charmcraft | open | Enhancement request (triaged) to let `charmcraft pack` build the bases/platforms of a multi-base charm in parallel; still unimplemented, scoped upstream to the whole craft ecosystem (CHARMCRAFT-655). | |
| #81 feat: multi-base support for charm build plans | craft-platforms | merged | Merged PR #81 as commit 519b705, adding multi-base charm build-plan support and fixing #73, with stricter shorthand validation and CraftPlatformsError. | |
| #2058 Multi-base charm uses same LXC container for different bases | charmcraft | closed | Closed in favor of upstream craft-application#600, which tracked platform-specific build-environment naming; builds were correct, but container reuse slowed iterative multi-base packs. | |
| #215 fix(charm): accept redundant multi-base charms | craft-platforms | merged | Merged PR #215 as commit 4879309, allowing redundant multi-base charms when they produce equivalent valid build plans and addressing canonical/charmcraft#2620. |