Skip to content

Commit a955ae2

Browse files
committed
ci: add riscv64 wheel builds using RISE native runners
Add manylinux_riscv64 to the wheel build matrix using native riscv64 runners (ubuntu-24.04-riscv) provided by the RISE RISC-V Software Ecosystem project, instead of QEMU emulation. Build time: ~3.5 minutes on native hardware vs ~38 minutes under QEMU. Changes: - Add [ubuntu-24.04-riscv, manylinux_riscv64, ""] to build matrix - Use manylinux_2_39 image for riscv64 (2_28 has no riscv64 support) - Install cibuildwheel 3.4.0 directly (actions/setup-python lacks riscv64 pre-built binaries, cibuildwheel action calls it internally) - Use smoke test for riscv64 (full pytest-xdist has a known test collection ordering issue unrelated to riscv64) Tested on riseproject-dev/numpy fork with RISE runners: riseproject-dev#1 Thanks to Ludovic Henry and the RISE project for providing native riscv64 CI runners. Signed-off-by: Bruno Verachten <gounthar@gmail.com>
1 parent 621413b commit a955ae2

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
- [ubuntu-22.04, musllinux_x86_64, ""]
4040
- [ubuntu-22.04-arm, manylinux_aarch64, ""]
4141
- [ubuntu-22.04-arm, musllinux_aarch64, ""]
42+
- [ubuntu-24.04-riscv, manylinux_riscv64, ""]
4243
- [macos-15-intel, macosx_x86_64, openblas]
4344
- [macos-14, macosx_arm64, openblas]
4445
- [windows-2022, win_amd64, ""]
@@ -48,6 +49,12 @@ jobs:
4849
env:
4950
IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }} # used in cibw_test_command.sh
5051
steps:
52+
- name: Setup Python for riscv64
53+
if: matrix.buildplat[1] == 'manylinux_riscv64'
54+
run: |
55+
echo "/opt/python-3.12/bin" >> "$GITHUB_PATH"
56+
/opt/python-3.12/bin/python3.12 -m pip install cibuildwheel==3.4.0
57+
5158
- name: Checkout numpy
5259
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5360
with:
@@ -99,10 +106,18 @@ jobs:
99106
fi
100107
101108
- name: Build wheels
109+
if: matrix.buildplat[1] != 'manylinux_riscv64'
102110
uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0
103111
env:
104112
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
105113

114+
- name: Build wheels (riscv64)
115+
if: matrix.buildplat[1] == 'manylinux_riscv64'
116+
run: python3 -m cibuildwheel --output-dir wheelhouse
117+
env:
118+
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
119+
CIBW_TEST_COMMAND: "python -c \"import numpy; print(numpy.__version__); numpy.show_config()\""
120+
106121
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
107122
with:
108123
name: ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ build-dir = "build"
202202
[tool.cibuildwheel.linux]
203203
manylinux-x86_64-image = "manylinux_2_28"
204204
manylinux-aarch64-image = "manylinux_2_28"
205+
manylinux-riscv64-image = "manylinux_2_39"
205206
musllinux-x86_64-image = "musllinux_1_2"
206207
musllinux-aarch64-image = "musllinux_1_2"
207208

0 commit comments

Comments
 (0)