diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e454038..2557471 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,13 +16,26 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: cargo test --release + # 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.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-latest # macOS arm64 native + x86_64 cross steps: - uses: actions/checkout@v5 @@ -37,16 +44,30 @@ 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_ARCHS_LINUX: "x86_64 aarch64" - CIBW_ARCHS_MACOS: "x86_64 arm64" - CIBW_SKIP: "*-musllinux_* *-win_*" - CIBW_BEFORE_BUILD: "pip install maturin" + 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" + # 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" + CIBW_ENVIRONMENT_LINUX: 'PATH="$HOME/.cargo/bin:$PATH"' CIBW_TEST_REQUIRES: "pytest hypothesis" CIBW_TEST_COMMAND: "pytest {package}/tests" with: @@ -54,7 +75,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" }]