Skip to content

Commit 6d72d21

Browse files
ffganmattip
authored andcommitted
Build riscv64+glibc wheel
Co-authored by: nijincheng@iscas.ac.cn; Signed-off-by: ffgan <sudoemt@gmail.com>
1 parent 7e85250 commit 6d72d21

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/posix.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
- { os: ubuntu-24.04-arm, PLAT: s390x, INTERFACE64: '0', MB_ML_VER: '2014', MB_ML_LIBC: manylinux}
4848
- { os: ubuntu-24.04-arm, PLAT: s390x, INTERFACE64: '1', MB_ML_VER: '2014', MB_ML_LIBC: manylinux}
4949

50+
- { os: ubuntu-24.04-arm, PLAT: riscv64, INTERFACE64: '0', MB_ML_VER: '_2_39', MB_ML_LIBC: manylinux}
51+
- { os: ubuntu-24.04-arm, PLAT: riscv64, INTERFACE64: '1', MB_ML_VER: '_2_39', MB_ML_LIBC: manylinux}
52+
5053
env:
5154
NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
5255
MB_ML_LIBC: ${{ matrix.MB_ML_LIBC }}
@@ -73,7 +76,7 @@ jobs:
7376
xcode-version: '15.4'
7477

7578
- name: Set up QEMU
76-
if: matrix.PLAT == 'ppc64le' || matrix.PLAT == 's390x'
79+
if: matrix.PLAT == 'ppc64le' || matrix.PLAT == 's390x' || matrix.PLAT == 'riscv64'
7780
uses: docker/setup-qemu-action@v3
7881
with:
7982
platforms: all
@@ -107,6 +110,7 @@ jobs:
107110
CIBW_MUSLLINUX_PPC64LE_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
108111
CIBW_MANYLINUX_S390X_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
109112
CIBW_MUSLLINUX_S390X_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
113+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ matrix.MB_ML_LIBC }}${{matrix.MB_ML_VER}}
110114

111115
- name: Upload wheels to artifacts
112116
uses: actions/upload-artifact@v4.3.0

tools/build_steps.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function get_plat_tag {
6868
local mb_ml_ver=${MB_ML_VER:-1}
6969
local mb_ml_libc=${MB_ML_LIBC:-manylinux}
7070
case $plat in
71-
i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le|loongarch64) ;;
71+
i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le|loongarch64|riscv64) ;;
7272
*) echo Did not recognize plat $plat; return 1 ;;
7373
esac
7474
local uname=${2:-$(uname)}
@@ -153,6 +153,9 @@ function build_lib {
153153
Linux-loongarch64)
154154
local target="GENERIC"
155155
;;
156+
Linux-riscv64)
157+
local target="GENERIC"
158+
;;
156159
*) echo "Strange plat value $plat"; exit 1 ;;
157160
esac
158161
case $interface64 in
@@ -185,7 +188,7 @@ function build_lib {
185188
echo "the utest samin/damin have been temporarily disabled."
186189
echo "QEMU does not support the 'lper' /'lpdr' instructions used"
187190
fi
188-
if [ "$plat" == "loongarch64" ] || [ "$plat" == "ppc64le" ] || [ "$plat" == "s390x" ]; then
191+
if [ "$plat" == "loongarch64" ] || [ "$plat" == "ppc64le" ] || [ "$plat" == "s390x" ] || [ "$plat" == "riscv64" ]; then
189192
sed -i 's/CTEST(fork, safety)/CTEST_SKIP(fork, safety)/g' ./utest/test_fork.c
190193
sed -i 's/CTEST(fork, safety_after_fork_in_parent)/CTEST_SKIP(fork, safety_after_fork_in_parent)/g' ./utest/test_post_fork.c
191194
echo "QEMU has a race condition preventing fork tests to work as expected"

0 commit comments

Comments
 (0)