Charmcraft 3 breaks charms with multiple run-on architectures
Metadata
Current evaluation
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.
Suggested action: —
No scores available.
Issue body
### Bug Description
For Jammy and below, charms with multiple `run-on` get the message `Architecture 'amd64-arm64-ppc64el-s390x' is not supported.` (or similar)
### To Reproduce
1. `git clone https://opendev.org/openstack/charm-vault.git`
2. `git switch stable/1.8`
3. `charmcraft pack` (with charmcraft 3)
### Environment
Linux charmcraft 3
### charmcraft.yaml
```shell
type: charm
parts:
charm:
plugin: dump
source: .
prime:
- actions/*
- charmhelpers/*
- files/*
- hooks/*
- lib/*
- templates/*
- actions.yaml
- config.yaml
- copyright
- hardening.yaml
- icon.svg
- LICENSE
- Makefile
- metadata.yaml
- README.md
bases:
- build-on:
- name: ubuntu
channel: "22.04"
architectures:
- amd64
run-on:
- name: ubuntu
channel: "22.04"
architectures: [amd64, s390x, ppc64el, arm64]
```
### Relevant log output
```shell
2024-06-10 14:08:02.305 Starting charmcraft, version 3.0.0.post46+ga44c03e
2024-06-10 14:08:02.305 Log verbosity level set to BRIEF
2024-06-10 14:08:02.305 Configuring application...
2024-06-10 14:08:02.305 Preparing application...
2024-06-10 14:08:02.306 Build plan: platform=None, build_for=None
2024-06-10 14:08:02.307 Loading project file '/home/lengau/Work/Code/charm-nova-compute/charmcraft.yaml'
2024-06-10 14:08:02.309 Warning: use of 'prime' in a charm part is deprecated and no longer works, see https://juju.is/docs/sdk/include-extra-files-in-a-charm
2024-06-10 14:08:02.339 Architecture 'amd64-arm64-ppc64el-s390x' is not supported.
2024-06-10 14:08:02.340 Traceback (most recent call last):
2024-06-10 14:08:02.340 File "/snap/charmcraft/3838/lib/python3.10/site-packages/craft_application/application.py", line 508, in run
2024-06-10 14:08:02.340 self.services.project = self.get_project(
2024-06-10 14:08:02.340 File "/snap/charmcraft/3838/lib/python3.10/site-packages/craft_application/application.py", line 303, in get_project
2024-06-10 14:08:02.340 yaml_data = self._transform_project_yaml(yaml_data, build_on, build_for)
2024-06-10 14:08:02.340 File "/snap/charmcraft/3838/lib/python3.10/site-packages/craft_application/application.py", line 601, in _transform_project_yaml
2024-06-10 14:08:02.340 self._expand_environment(yaml_data=yaml_data, build_for=build_for)
2024-06-10 14:08:02.340 File "/snap/charmcraft/3838/lib/python3.10/site-packages/craft_application/application.py", line 629, in _expand_environment
2024-06-10 14:08:02.340 info = craft_parts.ProjectInfo(
2024-06-10 14:08:02.340 File "/snap/charmcraft/3838/lib/python3.10/site-packages/craft_parts/infos.py", line 99, in __init__
2024-06-10 14:08:02.340 self._set_machine(arch)
2024-06-10 14:08:02.340 File "/snap/charmcraft/3838/lib/python3.10/site-packages/craft_parts/infos.py", line 333, in _set_machine
2024-06-10 14:08:02.340 raise errors.InvalidArchitecture(arch)
2024-06-10 14:08:02.340 craft_parts.errors.InvalidArchitecture: Architecture 'amd64-arm64-ppc64el-s390x' is not supported.
2024-06-10 14:08:02.340 Make sure the architecture name is correct.
2024-06-10 14:08:02.340 Recommended resolution: Make sure the architecture name is correct.
2024-06-10 14:08:02.340 Full execution log: '/home/lengau/.local/state/charmcraft/log/charmcraft-20240610-140802.305265.log'
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | 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. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as blocked by upstream craft-application issue #394. Charmcraft 3 fails to build charms with multiple run-on architectures, throwing an invalid architecture error. Resolution awaits the upstream fix. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as blocked by craft-application#394. The Charmcraft 3 multi-architecture run-on bug remains unresolved pending an upstream fix. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed and resolved via upstream fix in craft-application#394. The charmcraft 3 multi-architecture run-on build failure was fixed after the upstream craft-application issue was addressed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as blocked by craft-application#394. Charmcraft 3 incorrectly rejects charms with multiple run-on architectures. No fix was applied here. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1783 Charmcraft 3 no longer respects legacy bases architectures | charmcraft | closed | Fixed in 3.1.2. Charmcraft 3 ignored legacy bases architectures, defaulting to amd64. The bug stemmed from metadata generation failing to apply the current build plan to legacy definitions. The update restores correct architecture detection. | |
| #1853 Incorrect information in Charmhub for ARM64 variants of a charm | charmcraft | closed | Closed. Manifests incorrectly included all architectures instead of the specific build architecture due to a charmcraft bug. Resolved in charmcraft 3.1.2+; re-packaging charms generates correct manifests. | |
| #1874 charmcraft 3.2 not accepting non-vectorised build-on and build-for | charmcraft | closed | Closed without a code fix; reported a breaking change in charmcraft 3.2 requiring list syntax for build-on/build-for fields. Logged to internal Jira ticket CRAFT-3318. | |
| #1789 Unable to build multi-base subordinate charms on 24.04 | charmcraft | closed | 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. | |
| #1845 Building multiple charms simultaneously can cause caching errors | charmcraft | closed | Closed. Charmcraft will detect parallel builds and disable caching with a warning to prevent race conditions and zipfile errors during simultaneous charm builds. |