← Back to issue list

`uv` plugin produces architecture-mislabeled charm on cross-build (`build-on: amd64`, `build-for: arm64|ppc64el|s390x`)

View original Github issue

Metadata

Project
charmcraft
Number
#2685
Type
issue
State
open
Author
UtkarshBhatthere
Labels
—
Created
Updated
Closed
—

Current evaluation

uv plugin silently produces architecture-mislabeled charms on cross-build (build-on amd64, build-for arm64) — host-arch wheels packaged under target-arch manifest. Unlabelled, no maintainer response.

Suggested action: needs triage

Reason: The issue is a valid, well-documented bug with a precise reproducer and observed x86-64 .so files inside an arm64-tagged charm. Code inspection confirms the uv plugin's `uv sync` command lacks `--python-platform` and no target-arch detection exists in charmcraft's UvPlugin override, but the issue has no labels, comments, or maintainer acknowledgement yet, so it still requires triage.

Evaluated by: mr-cal-bot

Impact: 75 Quick Win: 27 Complexity: 55 Confidence: 78 Actionability: 80

Issue body

## Summary `charmcraft pack` with the `uv` plugin and a cross-arch `platforms:` entry (host arch `!=` target arch) succeeds without error and emits a `.charm` whose `manifest.yaml` declares the target architecture, but whose Python venv contains compiled wheels (`.so` files) built for the **host** architecture. The artifact is silently corrupt and will fail at import on a host of the declared architecture. ## Environment - charmcraft: 4.2.1 (snap, `latest/candidate`) - LXD: 5.21.4-aee7e08 (rev 38767, `5.21/stable`) - host arch: `x86_64` ## Reproduction `charmcraft.yaml`: ```yaml type: charm platforms: ubuntu-24.04-amd64: build-on: [ubuntu@24.04:amd64] build-for: [ubuntu@24.04:amd64] ubuntu-24.04-arm64: build-on: [ubuntu@24.04:amd64] build-for: [ubuntu@24.04:arm64] parts: charm: plugin: uv source: . build-snaps: [astral-uv] build-packages: [git] ``` `pyproject.toml` pulls in any wheel-bearing dependency, e.g. `cryptography`, `pydantic`, `pyyaml`. ``` $ charmcraft pack --platform ubuntu-24.04-arm64 -v ... Packed microceph_ubuntu-24.04-arm64.charm ``` No warning. No error. ## Observed ``` $ unzip -p microceph_ubuntu-24.04-arm64.charm manifest.yaml | head -7 charmcraft-version: 4.2.1 charmcraft-started-at: '2026-05-06T18:48:24.634836' bases: - name: ubuntu channel: '24.04' architectures: - arm64 ``` ``` $ unzip -l microceph_ubuntu-24.04-arm64.charm | grep -E '\.so' ... venv/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so ... venv/lib/python3.12/site-packages/pydantic_core/_pydantic_core.cpython-312-x86_64-linux-gnu.so ... venv/lib/python3.12/site-packages/yaml/_yaml.cpython-312-x86_64-linux-gnu.so ... (etc.) ``` ``` $ unzip -p microceph_ubuntu-24.04-arm64.charm \ venv/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so > /tmp/r.so $ file /tmp/r.so /tmp/r.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), ... ``` Same for `pydantic_core`: x86-64 ELF inside an artifact tagged `arm64`. Filenames carrying `*-x86_64-linux-gnu.so` survive in the venv. ## Expected One of: 1. **Fail the pack.** `uv` plugin (or charmcraft itself) detects target arch `!=` build host arch with no functioning cross-resolve and aborts with a clear error directing the user to a native runner. This is the safe default — silent mislabeling is the worst failure mode. 2. **Cross-resolve wheels.** `uv` plugin invokes `uv` with `--python-platform <target>` so manylinux wheels for the target architecture are downloaded and staged. (Source-only deps would still need a real cross-toolchain, which is out of scope; but the common manylinux case is solvable.) ## Workaround in use `charmcraft.yaml` is restricted to `build-on == build-for` entries. Non-amd64 publishes are gated on per-arch native self-hosted runners.

Evaluation history

Date Model Scores Action Summary
~deepseek/deepseek-pro-latest
Impact: 75
Quick Win: 27
Complexity: 55
Confidence: 78
Actionability: 80
needs triage uv plugin silently produces architecture-mislabeled charms on cross-build (build-on amd64, build-for arm64) — host-arch wheels packaged under target-arch manifest. Unlabelled, no maintainer response.
qwen/qwen3.6-35b-a3b
Impact: 75
Quick Win: 30
Complexity: 50
Confidence: 85
Actionability: 80
keep open uv plugin silently produces architecture-mislabeled charms on cross-build (build-on: amd64, build-for: arm64) with host-arch wheels instead of target-arch
qwen/qwen3.8-27b
Impact: 75
Quick Win: 22
Staleness: 55
Complexity: 70
Confidence: 70
Support Request: 5
needs triage uv plugin cross-build (build-on amd64, build-for arm64/ppc64el/s390x) silently packs a charm whose venv contains host-arch compiled wheels while manifest declares target arch. No maintainer response, no labels, 0 comments, 114 days old.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 60
Confidence: 90
Support Request: 10
needs triage uv plugin silently packages host-architecture binaries into charms targeting different architectures. Unlabeled, untriaged, and inactive for 76 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 75
Confidence: 85
Support Request: 10
needs triage uv plugin silently packages host-architecture binaries into charms targeting different architectures, causing runtime failures. Untriaged with no maintainer response after 62 days.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.