Charmcraft 3 no longer respects legacy bases architectures
Metadata
Current evaluation
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.
Resolution: closed resolved
Reason: PR #1795 was merged in commit 8b16cae4 and released in Charmcraft 3.1.2. It limits manifest.yaml bases for legacy bases charms to the current build rather than all configured bases.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
Building a charm on a non-amd64 architecture using the legacy Charmcraft 2 `bases` notation on Charmcraft 3 ignores the architecture and defaults to amd64 despite building on a different platform.
Example for this is the [postgresql-tes-app](https://github.com/canonical/postgresql-test-app) packing and CI tests passed fine, using a locally packed charm, but both amd64 and arm64 revisions got published as amd64 revisions.
The `manifest.yaml` inside the published arm64 revison (203) is:
```
charmcraft-version: 3.1.1
charmcraft-started-at: '2024-08-02T10:30:16.196847'
bases:
- name: ubuntu
channel: '22.04'
architectures:
- amd64
- name: ubuntu
channel: '22.04'
architectures:
- arm64
analysis:
attributes:
- name: language
result: python
- name: framework
result: operator
```
The packed charm is correctly marked as arm64
### To Reproduce
* Pack postgresql-test-app on arm64
* Publish on charmhub
* Deploy on amd64
### Environment
OS: Ubuntu 22.04 (Github runner)
Charmcraft: 3.1.1
### charmcraft.yaml
```shell
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
type: charm
bases:
- name: ubuntu
channel: "22.04"
architectures: [amd64]
- name: ubuntu
channel: "22.04"
architectures: [arm64]
parts:
charm:
override-pull: |
craftctl default
if [[ ! -f requirements.txt ]]
then
echo 'ERROR: Use "tox run -e build" instead of calling "charmcraft pack" directly' >&2
exit 1
fi
charm-strict-dependencies: true
libpq:
build-packages:
- libpq-dev
plugin: dump
source: /usr/lib/
source-type: local
prime:
- lib/
organize:
"*-linux-gnu/libpq.so*": lib/
```
### Relevant log output
```shell
Packing...
Packing charm postgresql-test-app_ubuntu-22.04-arm64.charm
Packed postgresql-test-app_ubuntu-22.04-arm64.charm
build-dev: commands_post[0]> mv requirements.txt requirements-last-build.txt
build-dev: OK (304.68=setup[0.95]+cmd[0.66,303.07,0.00] seconds)
congratulations :) (304.74 seconds)
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | 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. | |
| stealth/space-bunny-alpha | — | closed resolved | Charmcraft 3 wrote all legacy bases into manifest.yaml, so arm64 charms were published as amd64. Fixed by merged PR #1795 (commit 8b16cae4), limiting manifest bases to the current build plan; released in Charmcraft 3.1.2. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in Charmcraft 3.1.2 by merged PR #1795 (8b16cae4), which limits manifest.yaml bases to the current build so legacy bases no longer misidentifies arm64 charms. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | 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. | |
| qwen/qwen3.6-35b-a3b | — | — | Charmcraft 3 ignored legacy bases architectures, defaulting to amd64. Metadata generation failed to apply the current build plan to bases. Resolved and fixed in version 3.1.2. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in Charmcraft 3.1.2. Legacy bases architectures incorrectly defaulted to amd64 because metadata generation skipped the current build plan. The issue was resolved by correcting this logic. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Charmcraft 3 ignored legacy bases architectures, defaulting to amd64. Root cause was metadata generation failing to apply the current build plan. Fixed and released in version 3.1.2. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#1795
(confidence 100%)
Merged fix for limiting manifest.yaml bases; the 3.1.2 changelog confirms its inclusion.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1853 Incorrect information in Charmhub for ARM64 variants of a charm | charmcraft | closed | Charmcraft incorrectly packed legacy-base manifests with every declared architecture. PR #1795 (8b16cae4) fixed this in 3.1.2; affected charms must be repacked. | |
| #1792 fix(package): use correct legacy bases architectures | charmcraft | closed | PR #1792 fixing legacy bases architecture selection was closed unmerged on 2024-08-07, superseded by #1795, which was merged as commit 8b16cae4 and shipped in Charmcraft 3.1.2 to fix issue #1783. | |
| #1697 Charmcraft 3 breaks charms with multiple run-on architectures | charmcraft | closed | Closed as blocked by canonical/craft-application#394; no resolving Charmcraft PR, commit, or release was identified for the multi-architecture regression. | |
| #1983 `--bases-index` ignored on charmcraft 3 | charmcraft | open | `--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. |