Unable to build multi-base subordinate charms on 24.04
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed. The issue was resolved by adopting the multi-base configuration syntax and workflow detailed in PR #2054, which addresses charmcraft 3 platform requirements. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #861 No support for paralell builds for multi-base charms | charmcraft | open | Feature request to add optional parallel builds for multi-base charms (e.g. a --base-build-concurrency option). Triaged and acknowledged by maintainers as a valid enhancement; still open and unimplemented, with a recent 2025 comment noting it is a full cycle of work for the craft ecosystem. | |
| #2507 Cannot build charm when base is Questing and build-base is devel | charmcraft | open | charmcraft pack fails with 'Couldn't get EOL data for devel' when base=ubuntu@25.10 and build-base=ubuntu@devel on charmcraft 4.0.1. Unlabelled, no maintainer activity in 262 days; devel-base support has since been expanded in later releases. | |
| #313 Support building in different platforms. | charmcraft | closed | Closed after implementing cross-platform build support. Users can now specify bases in charmcraft.yaml to package charms compatible with multiple operating systems in a single build. | |
| #792 22.10 - Failed to build charm for bases index '0'. | charmcraft | closed | Rejected as not a Charmcraft bug. The build fails due to a missing series field in metadata.yaml when using the legacy charm tool. The author acknowledged the config change and will coordinate with the Juju team. | |
| #639 Can't build charm: Failed to build charm for bases index '0' | charmcraft | closed | Resolved as a jinja2 and setuptools version conflict. Provided a charmcraft.yaml workaround to install or pin setuptools. A later user confirmed charmcraft clean followed by pack also fixed it. Closed without code changes. | |
| #1267 Can't build charm targeted at the current development release: `Skipping 'bases[8].build-on[0]': channel 'devel' does not match host '23.10'.` | charmcraft | closed | Building charms with channel devel failed due to a host channel mismatch. The issue was closed as fixed in Charmcraft 3. | |
| #1697 Charmcraft 3 breaks charms with multiple run-on architectures | charmcraft | closed | Closed as blocked by an upstream fix in craft-application. Charmcraft 3 incorrectly concatenated multiple run-on architectures into a single invalid string, causing build failures. Resolution awaits the referenced upstream issue. | |
| #2058 Multi-base charm uses same LXC container for different bases | charmcraft | closed | Superseded by upstream issue canonical/craft-application#600. The LXC container reuse bug causing rebuild slowdowns for multi-base charms is deferred to craft-application and craft-providers for resolution. | |
| #383 commands/build: charm file name format support for bases (CRAFT-66) | charmcraft | merged | Merged following approval by three reviewers. Introduces charm file name format support for bases configuration, preserving the existing format as a legacy runtime path. Includes corresponding tests. (+98/-1 lines, 2 files changed) |