Skip to content

Commit 34ead0a

Browse files
gountharaleksandr.tseluykoofek
authored
feat: add riscv64 to Linux wheel build matrix (msgspec#987)
## Summary Add `linux_riscv64` wheels to the build matrix. ### Changes - Add riscv64 matrix entry (`ubuntu-latest`) to `build-wheels.yml` - Add QEMU setup step for riscv64 emulation on x86_64 runners ### Evidence - Tested wheel: [msgspec-0.19.0-cp313-cp313-linux_riscv64.whl](https://github.com/gounthar/riscv64-python-wheels/releases/tag/v2026.03.07-cp313) - Built natively on BananaPi F3 (SpacemiT K1, rv64imafdcv, 8 cores @ 1.6 GHz, 16 GB RAM) - Imports and passes basic smoke test on riscv64 ### Context - `manylinux_2_28_riscv64` is available in pypa/manylinux - cibuildwheel 3.x supports riscv64 via QEMU - Several packages already ship riscv64 wheels: aiohttp, yarl, multidict, propcache - RISC-V hardware is shipping (SiFive, SpacemiT, Sophgo SG2044) Ref: msgspec#986 --- Note: this work is part of the [RISE Project](https://riseproject.dev/) effort to improve Python ecosystem support on riscv64 platforms. Native riscv64 CI runners are available for free via [RISE RISC-V runners](https://github.com/apps/rise-risc-v-runners). --------- Signed-off-by: Bruno Verachten <[email protected]> Co-authored-by: aleksandr.tseluyko <[email protected]> Co-authored-by: Ofek Lev <[email protected]>
1 parent 4d0ca3f commit 34ead0a

2 files changed

Lines changed: 29 additions & 6 deletions

File tree

‎.github/workflows/build-wheels.yml‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,25 @@ on:
1313

1414
jobs:
1515
build-wheels:
16-
name: Build ${{ matrix.target }}
17-
runs-on: "${{ matrix.os }}"
16+
name: Build ${{ matrix.wheel.target }}
17+
runs-on: "${{ matrix.wheel.os }}"
1818
permissions:
1919
actions: read
2020
contents: read
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
include:
24+
wheel:
2525
- target: Linux (aarch64)
2626
os: ubuntu-24.04-arm
2727
archs: aarch64
2828
- target: Linux (x86_64)
2929
os: ubuntu-latest
3030
archs: x86_64
31+
- target: Linux (riscv64)
32+
os: ubuntu-24.04-riscv
33+
archs: riscv64
34+
required-label: build-riscv64
3135
- target: macOS (arm64)
3236
os: macos-latest
3337
archs: arm64
@@ -44,12 +48,25 @@ jobs:
4448
os: ubuntu-latest
4549
archs: wasm32
4650
cibw_platform: pyodide
51+
exclude:
52+
- wheel:
53+
target: Linux (riscv64)
54+
os: ubuntu-24.04-riscv
55+
archs: riscv64
56+
# Unlabeled PRs match riscv64's required-label; otherwise empty keeps it.
57+
required-label: >-
58+
${{
59+
github.event_name == 'pull_request' &&
60+
!contains(github.event.pull_request.labels.*.name, 'build-riscv64') &&
61+
'build-riscv64' ||
62+
''
63+
}}
4764
4865
env:
49-
CIBW_ARCHS: "${{ matrix.archs }}"
50-
CIBW_PLATFORM: "${{ matrix.cibw_platform || 'auto' }}"
66+
CIBW_ARCHS: "${{ matrix.wheel.archs }}"
67+
CIBW_PLATFORM: "${{ matrix.wheel.cibw_platform || 'auto' }}"
5168
CIBW_SKIP: "${{ !inputs.build-all && '*-musllinux_*' || '' }}"
52-
ARTIFACT_NAME: artifact-wheels-${{ matrix.cibw_platform || matrix.os }}-${{ matrix.archs }}
69+
ARTIFACT_NAME: artifact-wheels-${{ matrix.wheel.cibw_platform || matrix.wheel.os }}-${{ matrix.wheel.archs }}
5370
PACKAGE_DIR: dist/${{ inputs.sdist-name }}
5471

5572
steps:

‎.github/workflows/ci.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
pull_request:
88
branches:
99
- main
10+
types:
11+
- opened
12+
- synchronize
13+
- reopened
14+
- labeled
15+
- unlabeled
1016
paths:
1117
# Changes to the package itself
1218
- src/msgspec/**

0 commit comments

Comments
 (0)