From be0c8e9b9554677fbfac418fa52ccf45f3dc3a6a Mon Sep 17 00:00:00 2001 From: Christophe Pettus Date: Sat, 6 Jun 2026 21:47:17 -0700 Subject: [PATCH 1/3] ci(wheels): build on native runners; fix sdist readme path Replace the cross-compile/emulation matrix with one native runner per arch (ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-latest); each builds only its native arch (CIBW_ARCHS=auto), and Rust is installed inside the manylinux containers for the Linux wheels. This removes the two release-build failures: x86_64-on-arm64-macOS needed a rustup target that was not installed, and aarch64 Linux under QEMU ran 6h and was killed. Also point pyproject [project].readme at python/README.md instead of ../README.md, so `maturin sdist` stops failing on the disallowed `..` path. --- .github/workflows/wheels.yml | 29 ++++++++++++++++++++++------- python/pyproject.toml | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e454038..52b00a3 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -22,13 +22,26 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: cargo test --release + # One native runner per target arch -- no QEMU, no cross-compilation. + # Each runner builds only its own architecture (cibuildwheel's default + # CIBW_ARCHS=auto), which removes the two failure modes the old single + # ubuntu+macos matrix hit: x86_64-on-arm64-macOS cross-builds needed a + # rustup target that was not installed, and aarch64-Linux under QEMU + # emulation ran for 6h and was killed. Linux wheels build inside a + # manylinux container that ships no Rust, so CIBW_BEFORE_ALL_LINUX + # installs a native toolchain there; macOS builds on the host and uses + # the host toolchain from rust-toolchain below. wheels: needs: cargo-test-gate - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + include: + - runner: ubuntu-latest # Linux x86_64 + - runner: ubuntu-24.04-arm # Linux aarch64 (native ARM runner) + - runner: macos-13 # macOS x86_64 (Intel) + - runner: macos-latest # macOS arm64 (Apple Silicon) steps: - uses: actions/checkout@v5 @@ -42,11 +55,13 @@ jobs: uses: pypa/cibuildwheel@v2.19 env: CIBW_BUILD: "cp311-* cp312-* cp313-*" - CIBW_ARCHS_LINUX: "x86_64 aarch64" - CIBW_ARCHS_MACOS: "x86_64 arm64" - CIBW_SKIP: "*-musllinux_* *-win_*" - CIBW_BEFORE_BUILD: "pip install maturin" + CIBW_SKIP: "*-musllinux_*" CIBW_BUILD_FRONTEND: "build" + CIBW_BEFORE_BUILD: "pip install maturin" + # manylinux containers ship no Rust; install a native toolchain + # (fast -- native arch, no emulation) and put cargo on PATH. + CIBW_BEFORE_ALL_LINUX: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal" + CIBW_ENVIRONMENT_LINUX: 'PATH="$HOME/.cargo/bin:$PATH"' CIBW_TEST_REQUIRES: "pytest hypothesis" CIBW_TEST_COMMAND: "pytest {package}/tests" with: @@ -54,7 +69,7 @@ jobs: - uses: actions/upload-artifact@v7 with: - name: wheels-${{ matrix.os }} + name: wheels-${{ matrix.runner }} path: wheelhouse/*.whl sdist: diff --git a/python/pyproject.toml b/python/pyproject.toml index 23df5f2..e52960e 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "maturin" name = "chisel" version = "0.1.0" description = "Python binding for the Chisel transactional storage engine" -readme = "../README.md" +readme = "README.md" requires-python = ">=3.11" license = { text = "MIT" } authors = [{ name = "Christophe Pettus" }] From 167273b33dd56afcc95a251b2c43afa6b0e16bf2 Mon Sep 17 00:00:00 2001 From: Christophe Pettus Date: Sun, 7 Jun 2026 13:26:12 -0700 Subject: [PATCH 2/3] ci(wheels): drop i686 + Intel runner; cross-build x86_64 macOS The first native-runner attempt surfaced two issues: CIBW_ARCHS=auto pulled in an i686 (32-bit) build whose manylinux image cannot install rustup (rustup-init fails on a missing libatomic.so.1), and the macos-13 (Intel) hosted runner never got picked up (queued for hours). Fix: CIBW_ARCHS_LINUX=auto64 builds only the native 64-bit arch per runner (no i686), and macOS now builds both arches on the arm64 runner -- arm64 native and x86_64 cross-compiled (with the x86_64-apple-darwin target; the cross-built x86_64 mac wheel's test is skipped since it can't run on an arm64 host). --- .github/workflows/wheels.yml | 44 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 52b00a3..5531b48 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -6,14 +6,8 @@ on: workflow_dispatch: jobs: - # I59 (ISSUES.md, 2026-05-22): early cargo test gate. Without this, - # a tagged commit that's broken would still build wheels (cibuildwheel - # only runs pytest after the long wheel-build step) and fail very late. - # This job runs first, blocks both `wheels` and `sdist` via `needs:`, - # and adds ~30s of latency to a tag build in exchange for failing fast - # if the underlying Rust is broken. Bench-test the bench subcrate is - # already covered on every push by ci.yml's bench-tests job; we only - # gate the root crate here. + # I59 (ISSUES.md, 2026-05-22): early cargo test gate so a broken tagged + # commit fails fast instead of after the long wheel build. cargo-test-gate: runs-on: ubuntu-latest steps: @@ -22,15 +16,16 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: cargo test --release - # One native runner per target arch -- no QEMU, no cross-compilation. - # Each runner builds only its own architecture (cibuildwheel's default - # CIBW_ARCHS=auto), which removes the two failure modes the old single - # ubuntu+macos matrix hit: x86_64-on-arm64-macOS cross-builds needed a - # rustup target that was not installed, and aarch64-Linux under QEMU - # emulation ran for 6h and was killed. Linux wheels build inside a - # manylinux container that ships no Rust, so CIBW_BEFORE_ALL_LINUX - # installs a native toolchain there; macOS builds on the host and uses - # the host toolchain from rust-toolchain below. + # One runner per native platform, no QEMU and no 32-bit: + # * Linux x86_64 and aarch64 each on their own native runner. + # * macOS builds BOTH arches on the arm64 runner -- arm64 native and + # x86_64 cross-compiled -- because Intel macOS hosted runners are not + # reliably available (macos-13 sat queued for hours). + # CIBW_ARCHS_LINUX=auto64 keeps each Linux runner to its native 64-bit arch + # and excludes i686 (its manylinux image's rustup-init fails on a missing + # libatomic.so.1). Linux wheels build inside a manylinux container that ships + # no Rust, so CIBW_BEFORE_ALL_LINUX installs a native toolchain there; macOS + # builds on the host and uses the rust-toolchain targets below. wheels: needs: cargo-test-gate runs-on: ${{ matrix.runner }} @@ -40,8 +35,7 @@ jobs: include: - runner: ubuntu-latest # Linux x86_64 - runner: ubuntu-24.04-arm # Linux aarch64 (native ARM runner) - - runner: macos-13 # macOS x86_64 (Intel) - - runner: macos-latest # macOS arm64 (Apple Silicon) + - runner: macos-latest # macOS arm64 native + x86_64 cross steps: - uses: actions/checkout@v5 @@ -50,16 +44,24 @@ jobs: python-version: "3.12" - uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-apple-darwin, x86_64-apple-darwin - name: Build wheels uses: pypa/cibuildwheel@v2.19 env: CIBW_BUILD: "cp311-* cp312-* cp313-*" CIBW_SKIP: "*-musllinux_*" + # native 64-bit per runner: x86_64 on ubuntu-latest, aarch64 on + # ubuntu-24.04-arm. Excludes i686. + CIBW_ARCHS_LINUX: "auto64" + # both mac arches on the arm64 runner; x86_64 is cross-compiled. + CIBW_ARCHS_MACOS: "arm64 x86_64" + # the cross-built x86_64 mac wheel cannot be import-tested on an + # arm64 host -- build it, skip its test. + CIBW_TEST_SKIP: "*-macosx_x86_64" CIBW_BUILD_FRONTEND: "build" CIBW_BEFORE_BUILD: "pip install maturin" - # manylinux containers ship no Rust; install a native toolchain - # (fast -- native arch, no emulation) and put cargo on PATH. CIBW_BEFORE_ALL_LINUX: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal" CIBW_ENVIRONMENT_LINUX: 'PATH="$HOME/.cargo/bin:$PATH"' CIBW_TEST_REQUIRES: "pytest hypothesis" From f9b857af16afae5517eb36e75aaf738792ed2dc4 Mon Sep 17 00:00:00 2001 From: Christophe Pettus Date: Sun, 7 Jun 2026 13:37:05 -0700 Subject: [PATCH 3/3] ci(wheels): pin MACOSX_DEPLOYMENT_TARGET=11.0 for the mac build The x86_64 wheel built fine but delocate rejected it -- rustc's x86_64-apple-darwin floor is 10.12, above cibuildwheel's default 10.9 tag. Pinning both mac arches to 11.0 makes the wheel tag match the .so. --- .github/workflows/wheels.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5531b48..2557471 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -60,6 +60,10 @@ jobs: # the cross-built x86_64 mac wheel cannot be import-tested on an # arm64 host -- build it, skip its test. CIBW_TEST_SKIP: "*-macosx_x86_64" + # rustc's x86_64-apple-darwin floor is 10.12, above cibuildwheel's + # default 10.9 tag, so delocate rejected the wheel. Pin both mac + # arches to 11.0 (arm64's floor) so the wheel tag matches the .so. + CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=11.0" CIBW_BUILD_FRONTEND: "build" CIBW_BEFORE_BUILD: "pip install maturin" CIBW_BEFORE_ALL_LINUX: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal"