Incorrect information in Charmhub for ARM64 variants of a charm
Metadata
Current evaluation
Charmcraft incorrectly packed legacy-base manifests with every declared architecture. PR #1795 (8b16cae4) fixed this in 3.1.2; affected charms must be repacked.
Resolution: closed resolved
Reason: The maintainer identified #1783 as the root cause and advised repacking charms with Charmcraft 3.1.2 or newer. Merged PR #1795, commit 8b16cae4, limits manifest.yaml bases to the architecture used for the current build.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
As filed in https://bugs.launchpad.net/snapstore-server/+bug/2060271
the `github-runner` charm has both AMD64 and ARM64 builds. In particular rev 234 is an amd64 build, and 235 is an arm64 build.
When Juju goes to query charmhub, it gets a response that indicates that rev 234 supports both amd64 and arm64. I don't know whether this was a bug in how the data got recorded to charmhub (eg a charmcraft bug), or in how charmhub is using the information it currently has.
But across Juju, Charmhub, and Charmcraft we definitely have a bug around how the data is getting stored and then retrieved.
### To Reproduce
See bug 2060271, but:
```
juju --debug --logging-config "#charmhub=TRACE" download --arch arm64 github-runner --channel latest/beta
```
You can see that the response from Charmhub is saying:
```
"bases": [
{
"architecture": "amd64",
"channel": "22.04",
"name": "ubuntu"
},
{
"architecture": "arm64",
"channel": "22.04",
"name": "ubuntu"
}
],
...
"resources": [],
"revision": 234,
"summary": "Creates a group of self-hosted github runners.",
"type": "charm",
"version": "234"
```
However, revision 234 only supports amd64. (The revision 235 was the one that supported arm64.)
### Environment
One plausible explanation is that during upload of the arm64 build, something was incorrectly recorded in charmhub that made it think that rev 234 also supported arm.
### charmcraft.yaml
```shell
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.
type: charm
parts:
charm:
charm-python-packages:
- setuptools # for jinja2
build-packages:
- git # for installing git source of pylxd
- libffi-dev # for cffi
- libssl-dev # for cryptography
- rust-all # for cryptography
- pkg-config # for cryptography
scripts:
plugin: dump
source: scripts
organize:
build-lxd-image.sh: scripts/build-lxd-image.sh
reactive_runner.py: scripts/reactive_runner.py
repo_policy_compliance_service.py: scripts/repo_policy_compliance_service.py
prime:
- scripts/
bases:
- build-on:
- name: "ubuntu"
channel: "22.04"
architectures:
- amd64
run-on:
- name: "ubuntu"
channel: "22.04"
architectures:
- amd64
- build-on:
- name: "ubuntu"
channel: "22.04"
architectures:
- arm64
run-on:
- name: "ubuntu"
channel: "22.04"
architectures:
- arm64
```
### Relevant log output
```shell
I don't believe there is a relevant log for charmcraft.
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Charmcraft incorrectly packed legacy-base manifests with every declared architecture. PR #1795 (8b16cae4) fixed this in 3.1.2; affected charms must be repacked. | |
| stealth/space-bunny-alpha | — | closed resolved | Charmcraft generated manifests listing all declared architectures instead of the architecture built. Fixed in 3.1.2 via canonical/charmcraft#1783; affected charms must be repacked. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in Charmcraft 3.1.2: re-packaging charms now produces correct per-build architecture metadata. The closing maintainer comment linked the underlying bug to #1783. | |
| stealth/space-bunny-alpha | — | closed resolved | Charmcraft #1783 was identified as the cause and fixed in 3.1.2: manifests listed all architectures instead of the current build’s. Repacking charms corrects their Charmhub metadata. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | 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. | |
| qwen/qwen3.6-35b-a3b | — | — | Resolved as charmcraft bug #1783. Manifests incorrectly included all architectures instead of the specific build architecture. Re-packaging with charmcraft 3.1.2 or newer generates correct manifests and fixes the issue. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed. Resolved as charmcraft bug #1783. Manifests incorrectly included all architectures instead of the specific build architecture. Re-packaging charms with charmcraft 3.1.2 or newer generates correct architecture-specific manifests. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed via charmcraft #1783. Manifests incorrectly listed all architectures instead of the specific build architecture. Repackaging with charmcraft 3.1.2+ generates correct manifests, resolving the incorrect Charmhub data. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/charmcraft#1783
(confidence 100%)
Root-cause issue for manifests listing all declared architectures instead of the current build architecture.
-
Likely Fixed By:
canonical/charmcraft#1795
(confidence 100%)
Merged fix PR, commit 8b16cae4, released in Charmcraft 3.1.2.
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. | |
| #1400 fix: always include architectures in charm manifest | charmcraft | merged | Merged canonical/charmcraft#1400 to always serialize architecture fields in generated charm manifests, including inferred defaults; rendering and tests were updated across nine files. | |
| #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. | |
| #1791 Charmcraft 3 including previously-built charms in new charm builds | charmcraft | closed | Fixed in PR #1793 (commit affc209b): subsequent charmcraft pack runs no longer include previously built .charm artifacts in the new charm. |