From f2ae5dfc010ceef52cc2f579da682698b1336ace Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Thu, 12 Mar 2026 10:00:17 +0100 Subject: [PATCH 1/4] feat: add riscv64 to Linux wheel build matrix Add QEMU emulation for riscv64 and include riscv64 in the build matrix so that linux_riscv64 wheels are built alongside existing architectures. --- .github/workflows/build-wheels.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index e0092df2..d4950c3f 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -36,6 +36,12 @@ jobs: CIBW_SKIP: "${{ !inputs.build-all && '*-musllinux_*' || '' }}" steps: + - name: Set up QEMU + if: matrix.archs == 'riscv64' + uses: docker/setup-qemu-action@v3 + with: + platforms: riscv64 + - name: Checkout code uses: actions/checkout@v5 From 1dab4f5583921677e19c0eeedbe62cf322dd1ec6 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Sun, 5 Apr 2026 12:22:00 +0200 Subject: [PATCH 2/4] ci: upgrade setup-qemu-action v3 to v4 Signed-off-by: Bruno Verachten --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index d4950c3f..cdb1c89b 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Set up QEMU if: matrix.archs == 'riscv64' - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 with: platforms: riscv64 From deb46b3d2553b25435c37525d28db38e2861bce0 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Sat, 11 Apr 2026 21:44:01 +0200 Subject: [PATCH 3/4] ci: fix riscv64 matrix entry and use native RISE runner The QEMU setup step was present but the riscv64 matrix entry was missing, so it never triggered. Replace the QEMU approach with a native ubuntu-24.04-riscv runner (RISE Project). The pypa/cibuildwheel action calls actions/setup-python internally, which has no riscv64 binaries. Add a dedicated riscv64 step that installs cibuildwheel via pip and runs it directly, consistent with how other projects handle native riscv64 CI with RISE runners. Signed-off-by: Bruno Verachten --- .github/workflows/build-wheels.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index cdb1c89b..a2f72167 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -23,6 +23,8 @@ jobs: archs: aarch64 - os: ubuntu-latest archs: x86_64 + - os: ubuntu-24.04-riscv + archs: riscv64 - os: macos-latest archs: arm64 - os: macos-15-intel @@ -36,12 +38,6 @@ jobs: CIBW_SKIP: "${{ !inputs.build-all && '*-musllinux_*' || '' }}" steps: - - name: Set up QEMU - if: matrix.archs == 'riscv64' - uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 - with: - platforms: riscv64 - - name: Checkout code uses: actions/checkout@v5 @@ -57,7 +53,21 @@ jobs: if: runner.os != 'Linux' uses: astral-sh/setup-uv@v7 + # On riscv64 the pypa/cibuildwheel action calls actions/setup-python + # internally, which has no riscv64 binaries. Install and run cibuildwheel + # directly via pip instead. + - name: Build & Test Wheels (riscv64 native) + if: matrix.archs == 'riscv64' + run: | + export PATH="/opt/python-3.12/bin:$PATH" + pip install cibuildwheel==3.2.1 + python3 -m cibuildwheel --output-dir wheelhouse dist/${{ inputs.sdist-name }} + env: + CIBW_ARCHS: riscv64 + CIBW_CONFIG_FILE: .cibuildwheel.toml + - name: Build & Test Wheels + if: matrix.archs != 'riscv64' uses: pypa/cibuildwheel@v3.2.1 with: config-file: .cibuildwheel.toml From fa85a5786adf3769036623a111f0beb8f5902940 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Sat, 11 Apr 2026 21:52:25 +0200 Subject: [PATCH 4/4] ci: add standalone riscv64 benchmark workflow workflow_dispatch trigger that builds the sdist then runs cibuildwheel on the native ubuntu-24.04-riscv runner. Bypasses the full CI pipeline which requires a fork release to exist. Produces real build times for upstream discussion. Signed-off-by: Bruno Verachten --- .github/workflows/benchmark-riscv64.yml | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/benchmark-riscv64.yml diff --git a/.github/workflows/benchmark-riscv64.yml b/.github/workflows/benchmark-riscv64.yml new file mode 100644 index 00000000..39ad9ef1 --- /dev/null +++ b/.github/workflows/benchmark-riscv64.yml @@ -0,0 +1,58 @@ +name: Benchmark riscv64 wheel build + +on: + workflow_dispatch: + +# Standalone riscv64-only wheel build for timing purposes. +# Bypasses the full CI pipeline (which requires a release to exist on the fork). +# Produces real build times on ubuntu-24.04-riscv (RISE native runner) for +# upstream discussion at jcrist/msgspec#987. + +permissions: + contents: read + +jobs: + sdist: + name: Build source distribution + runs-on: ubuntu-latest + outputs: + sdist-name: ${{ steps.build.outputs.sdist-name }} + steps: + - uses: actions/checkout@v5 + - uses: astral-sh/setup-uv@v7 + - name: Build sdist + id: build + run: | + uv build --sdist + sdist_name=$(basename dist/*.tar.gz) + echo "sdist-name=${sdist_name}" >> "$GITHUB_OUTPUT" + - uses: actions/upload-artifact@v5 + with: + name: artifact-sdist + path: dist/${{ steps.build.outputs.sdist-name }} + if-no-files-found: error + + build-riscv64: + name: Build wheels on ubuntu-24.04-riscv for riscv64 + needs: sdist + runs-on: ubuntu-24.04-riscv + steps: + - uses: actions/checkout@v5 + - name: Download source distribution + uses: actions/download-artifact@v6 + with: + name: artifact-sdist + path: dist + - name: Build & Test Wheels (riscv64 native) + run: | + export PATH="/opt/python-3.12/bin:$PATH" + pip install cibuildwheel==3.2.1 + python3 -m cibuildwheel --output-dir wheelhouse dist/${{ needs.sdist.outputs.sdist-name }} + env: + CIBW_ARCHS: riscv64 + CIBW_CONFIG_FILE: .cibuildwheel.toml + - uses: actions/upload-artifact@v5 + with: + name: artifact-wheels-riscv64 + path: wheelhouse/*.whl + if-no-files-found: error