From 22f1821a67a21b01c4c6f4bd9ef1810cf16318c2 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Thu, 12 Mar 2026 10:00:20 +0100 Subject: [PATCH 1/8] feat: add riscv64 to Linux wheel build matrix Add QEMU emulation for riscv64 and include manylinux_2_28 riscv64 entry in the build-native-wheels matrix. --- .github/workflows/wheels.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ed49f15c0b8..ec0803de42e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -116,6 +116,12 @@ jobs: with: python-version: "3.x" + - name: Set up QEMU + if: matrix.cibw_arch == 'riscv64' + uses: docker/setup-qemu-action@v3 + with: + platforms: riscv64 + - name: Install cibuildwheel run: | python3 -m pip install -r .ci/requirements-cibw.txt From 7b026c67801c00b8a28b667aff912f6d9b2fe747 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Thu, 12 Mar 2026 22:37:33 +0100 Subject: [PATCH 2/8] feat(riscv64): add riscv64 to build-native-wheels matrix --- .github/workflows/wheels.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ec0803de42e..809e4dd32d1 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -94,6 +94,11 @@ jobs: os: ubuntu-24.04-arm cibw_arch: aarch64 build: "*manylinux*" + - name: "manylinux_2_28 riscv64" + platform: linux + os: ubuntu-latest + cibw_arch: riscv64 + build: "cp3{12,13}-manylinux*" - name: "iOS arm64 device" platform: ios os: macos-latest From 816fe45896ae3f9778862496f817c1b13b320a33 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Sat, 28 Mar 2026 09:32:09 +0100 Subject: [PATCH 3/8] ci: use manylinux_2_39 for riscv64 (2_28 has no riscv64 image) --- .github/workflows/wheels.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 74070208c28..1543436dd4d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -94,11 +94,12 @@ jobs: os: ubuntu-24.04-arm cibw_arch: aarch64 build: "*manylinux*" - - name: "manylinux_2_28 riscv64" + - name: "manylinux_2_39 riscv64" platform: linux os: ubuntu-latest cibw_arch: riscv64 build: "cp3{12,13}-manylinux*" + manylinux: "manylinux_2_39" - name: "iOS arm64 device" platform: ios os: macos-latest @@ -142,6 +143,7 @@ jobs: CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux }} CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: ${{ matrix.manylinux }} CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux }} + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ matrix.manylinux }} CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }} MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }} From d5e42ac963e582b8a6d5967a8c2969a9a3c31969 Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Fri, 3 Apr 2026 15:22:20 +1100 Subject: [PATCH 4/8] Update docker/setup-qemu-action --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 608d218cd30..40ed4814f44 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -124,7 +124,7 @@ jobs: - name: Set up QEMU if: matrix.cibw_arch == 'riscv64' - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: platforms: riscv64 From 0ccd26a38ba9a8f44271a592a4c5b24815813441 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Sun, 5 Apr 2026 11:57:21 +0200 Subject: [PATCH 5/8] fix: update EXPECTED_DISTS to 68 (66 base + 2 riscv64 wheels) After upstream dropped free-threaded wheels, EXPECTED_DISTS went from 75 to 66. Adding cp312 and cp313 manylinux_2_39_riscv64 brings it to 68. Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 596ef95633f..7ce72286553 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -39,7 +39,7 @@ concurrency: cancel-in-progress: true env: - EXPECTED_DISTS: 66 + EXPECTED_DISTS: 68 FORCE_COLOR: 1 jobs: From 37f731dda5219df934593e88cd94f2a39f573fd1 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Sun, 5 Apr 2026 14:49:40 +0200 Subject: [PATCH 6/8] fix: disable libjpeg-turbo SIMD on riscv64 to avoid 3.1.4.1 build error libjpeg-turbo 3.1.4.1 simdcoverage.c references jsimd_can_encode_mcu_AC_refine_prepare which is only declared in the RVV SIMD extensions added to upstream main (commit 9817c40) but not included in any stable release yet. Building with -DWITH_SIMD=FALSE avoids the error; riscv64 has no production SIMD support in 3.1.4.1 in any case. Signed-off-by: Bruno Verachten --- .github/workflows/wheels-dependencies.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 7750a2e07b5..0d93db20792 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -267,6 +267,13 @@ function build { fi build_simple libxcb $LIBXCB_VERSION https://www.x.org/releases/individual/lib + # libjpeg-turbo 3.1.4.1 simdcoverage.c references riscv64 RVV SIMD + # functions that are only in upstream main and not yet released. Disable + # SIMD for riscv64 to avoid the build error; there is no production + # riscv64 SIMD support in this version anyway. + if [[ "$(uname -m)" == "riscv64" ]]; then + HOST_CMAKE_FLAGS="${HOST_CMAKE_FLAGS} -DWITH_SIMD=FALSE" + fi build_libjpeg_turbo if [[ -n "$IS_MACOS" ]]; then # Custom tiff build to include jpeg; by default, configure won't include From ec1c53d6d7aa07d4389f17f9e2c735bb92d016c1 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Sun, 5 Apr 2026 17:55:58 +0200 Subject: [PATCH 7/8] fix: bump cibuildwheel to 3.4.1 for correct riscv64 manylinux_2_39 image pin cibuildwheel 3.4.0 pins manylinux_2_39_riscv64 to 2026.03.01-1 which does not exist on quay.io (earliest available tag is 2026.03.06-3). 3.4.1 corrects the pin to 2026.03.20-1. Signed-off-by: Bruno Verachten --- .ci/requirements-cibw.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/requirements-cibw.txt b/.ci/requirements-cibw.txt index fd4183aff35..c824c10bce7 100644 --- a/.ci/requirements-cibw.txt +++ b/.ci/requirements-cibw.txt @@ -1 +1 @@ -cibuildwheel==3.4.0 +cibuildwheel==3.4.1 From db188af557353ba0b3176ad261d30e3e47214775 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Mon, 6 Apr 2026 12:37:18 +0200 Subject: [PATCH 8/8] ci: disable libaom RVV optimizations for riscv64 libaom's riscv64 RVV code (highbd_convolve_rvv.c) calls functions without declarations; GCC 14 in manylinux_2_39 treats this as an error. Pass -DAOM_TARGET_CPU=generic for riscv64 to skip the arch-specific code. QEMU-based builds don't benefit from RVV optimizations anyway. Signed-off-by: Bruno Verachten --- .github/workflows/wheels-dependencies.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 0d93db20792..771671e82c0 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -204,6 +204,12 @@ function build_libavif { -DAVIF_CODEC_DAV1D=LOCAL ) fi + # libaom's riscv64 RVV code calls functions without declarations, which + # GCC 14 (manylinux_2_39) treats as errors. Disable arch-specific AOM + # optimizations for riscv64; QEMU-based builds don't benefit from them. + if [[ "$(uname -m)" == "riscv64" ]]; then + libavif_cmake_flags+=(-DAOM_TARGET_CPU=generic) + fi local out_dir=$(fetch_unpack https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$LIBAVIF_VERSION.tar.gz libavif-$LIBAVIF_VERSION.tar.gz)