← 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 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.

Suggested action: needs triage

Reason: No labels, no comments, no maintainer acknowledgement in 114 days, so it has not been triaged. The report is a well-evidenced real bug (x86-64 .so files inside an arm64-tagged charm), and the uv plugin code in craft-parts (uv sync with no --python-platform) confirms the mechanism, but the fix requires an architectural decision (fail-fast vs cross-resolve) and possibly a craft-parts change, so it needs maintainer triage rather than auto-closing.

Impact: 75 Quick Win: 22.5 Staleness: 55 Complexity: 70 Confidence: 70 Support Request: 5

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
qwen/qwen3.8-27b
Impact: 75
Quick Win: 22.5
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.
qwen3.6-35b-moe-q4
Staleness: 60
Complexity: 60
Confidence: 90
Support Request: 10
needs triage uv plugin silently packages host-architecture compiled wheels into cross-architecture charms, causing runtime failures. Untriaged, no maintainer response after 49 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 55
Confidence: 90
Support Request: 5
needs triage uv plugin silently packages host-arch wheels into cross-arch charms, causing runtime failures. Build succeeds but produces corrupt artifacts. Open, unassigned, no comments. Awaiting triage to fail on arch mismatch or implement cross-resolve.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.