From 6f79d7b2ea8ade3f2045fac08f43494d5e2c5663 Mon Sep 17 00:00:00 2001 From: Paul Wallrabe Date: Mon, 22 Jun 2026 14:06:32 +0200 Subject: [PATCH 1/2] fix(container): pin UV binary to build platform in cross-compilation stages COPY --from= resolves the source image against the target platform, not the stage platform. In builder stages pinned to $BUILDPLATFORM, this copies an aarch64 UV binary into an amd64 container, causing QEMU failures when UV tries to run aarch64 Python. Use a named stage pinned to $BUILDPLATFORM for the UV image so the COPY always gets the native-architecture binary. Co-Authored-By: Claude Opus 4.6 (1M context) --- python/.devfile/Containerfile.client | 3 ++- python/Containerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/.devfile/Containerfile.client b/python/.devfile/Containerfile.client index 82bc7ebb4..31654c16f 100644 --- a/python/.devfile/Containerfile.client +++ b/python/.devfile/Containerfile.client @@ -1,5 +1,6 @@ +FROM --platform=$BUILDPLATFORM ghcr.io/astral-sh/uv:0.11.21@sha256:ff07b86af50d4d9391d9daf4ff89ce427bc544f9aae87057e69a1cc0aa369946 AS uv-bin FROM --platform=$BUILDPLATFORM registry.fedoraproject.org/fedora:44 AS builder -COPY --from=ghcr.io/astral-sh/uv:0.11.21@sha256:ff07b86af50d4d9391d9daf4ff89ce427bc544f9aae87057e69a1cc0aa369946 /uv /uvx /bin/ +COPY --from=uv-bin /uv /uvx /bin/ RUN dnf install -y make git && \ dnf clean all && \ rm -rf /var/cache/dnf diff --git a/python/Containerfile b/python/Containerfile index 207aab771..590191c3b 100644 --- a/python/Containerfile +++ b/python/Containerfile @@ -1,5 +1,6 @@ +FROM --platform=$BUILDPLATFORM ghcr.io/astral-sh/uv:0.11.21@sha256:ff07b86af50d4d9391d9daf4ff89ce427bc544f9aae87057e69a1cc0aa369946 AS uv-bin FROM --platform=$BUILDPLATFORM registry.fedoraproject.org/fedora:44 AS builder -COPY --from=ghcr.io/astral-sh/uv:0.11.21@sha256:ff07b86af50d4d9391d9daf4ff89ce427bc544f9aae87057e69a1cc0aa369946 /uv /uvx /bin/ +COPY --from=uv-bin /uv /uvx /bin/ RUN dnf install -y make git && \ dnf clean all && \ rm -rf /var/cache/dnf From 0bc05af3833834fa74fada61aba312ea92e0d926 Mon Sep 17 00:00:00 2001 From: Paul Wallrabe Date: Mon, 22 Jun 2026 14:53:54 +0200 Subject: [PATCH 2/2] fix(test): isolate uv cache per package to prevent parallel race Parallel make test targets share a single UV cache directory, causing rename collisions on macOS (os error 66) when multiple uv processes write simultaneously. Co-Authored-By: Claude Opus 4.6 (1M context) --- python/.gitignore | 3 +++ python/Makefile | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/python/.gitignore b/python/.gitignore index 3c793c7e2..1fdc54b57 100644 --- a/python/.gitignore +++ b/python/.gitignore @@ -169,4 +169,7 @@ cython_debug/ # Ruff cache .ruff_cache/ + +# Per-package uv cache (parallel test isolation) +.uv-cache/ mitmproxy-ca-cert.pem diff --git a/python/Makefile b/python/Makefile index 922f5057d..6b513ce2d 100644 --- a/python/Makefile +++ b/python/Makefile @@ -85,7 +85,7 @@ pkg-test-%: packages/% @mkdir -p $(LOGS_DIR) @rm -f $(LOGS_DIR)/$*.failed @bash -c 'set -o pipefail; \ - PYTHONUNBUFFERED=1 uv run --isolated --directory $< pytest 2>&1 | tee $(LOGS_DIR)/$*.log; \ + UV_CACHE_DIR="$(CURDIR)/.uv-cache/$*" PYTHONUNBUFFERED=1 uv run --isolated --directory $< pytest 2>&1 | tee $(LOGS_DIR)/$*.log; \ rc=$$?; \ if [ $$rc -ne 0 ] && [ $$rc -ne 5 ]; then \ touch $(LOGS_DIR)/$*.failed; \ @@ -93,7 +93,7 @@ pkg-test-%: packages/% true' else pkg-test-%: packages/% - uv run --isolated --directory $< pytest || [ $$? -eq 5 ] + UV_CACHE_DIR="$(CURDIR)/.uv-cache/$*" uv run --isolated --directory $< pytest || [ $$? -eq 5 ] endif pkg-ty-%: packages/% @@ -147,6 +147,7 @@ clean-test: -rm -f .coverage -rm -f coverage.xml -rm -rf htmlcov + -rm -rf .uv-cache clean-docs: uv run --isolated --all-packages --group docs $(MAKE) -C docs clean