From df4aa8604ce59df904d96cb658d3f46a81efe15b Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 15:06:09 +0100 Subject: [PATCH 01/16] ci: add riscv64 native wheel build using RISE runners Add manylinux_riscv64 to the wheel build matrix using RISE RISC-V native runners (RISCV64 label) instead of QEMU emulation. Also allow the workflow to run on the riseproject-dev fork. Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8fb5173f7716..5ad8c64a72cc 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -27,7 +27,7 @@ jobs: build_wheels: name: Build wheel ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }} # To enable this job on a fork, comment out: - if: github.repository == 'numpy/numpy' + if: github.repository == 'numpy/numpy' || github.repository == 'riseproject-dev/numpy' runs-on: ${{ matrix.buildplat[0] }} strategy: fail-fast: false @@ -39,6 +39,7 @@ jobs: - [ubuntu-22.04, musllinux_x86_64, ""] - [ubuntu-22.04-arm, manylinux_aarch64, ""] - [ubuntu-22.04-arm, musllinux_aarch64, ""] + - [RISCV64, manylinux_riscv64, ""] - [macos-15-intel, macosx_x86_64, openblas] - [macos-14, macosx_arm64, openblas] - [windows-2022, win_amd64, ""] From 597ff4aea52c74f59c6c88fafd1eb7a3f5eb6b49 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 15:11:35 +0100 Subject: [PATCH 02/16] fix: use correct RISE runner label ubuntu-24.04-riscv 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 5ad8c64a72cc..37961251689f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -39,7 +39,7 @@ jobs: - [ubuntu-22.04, musllinux_x86_64, ""] - [ubuntu-22.04-arm, manylinux_aarch64, ""] - [ubuntu-22.04-arm, musllinux_aarch64, ""] - - [RISCV64, manylinux_riscv64, ""] + - [ubuntu-24.04-riscv, manylinux_riscv64, ""] - [macos-15-intel, macosx_x86_64, openblas] - [macos-14, macosx_arm64, openblas] - [windows-2022, win_amd64, ""] From 5eb5501d82108c4e9ace19a2dd36a8defeeab3ce Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 15:14:28 +0100 Subject: [PATCH 03/16] fix: install system Python on riscv64 runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit actions/setup-python has no pre-built Python for riscv64. Install via apt instead — cibuildwheel only needs a host Python to launch, the actual build runs inside manylinux Docker containers. Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 37961251689f..bded7b9af829 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -55,6 +55,13 @@ jobs: submodules: true persist-credentials: false + - name: Setup Python for riscv64 + if: matrix.buildplat[1] == 'manylinux_riscv64' + run: | + sudo apt-get update + sudo apt-get install -y python3 python3-pip python3-venv + echo "/usr/bin" >> "$GITHUB_PATH" + - name: Setup MSVC (32-bit) if: ${{ matrix.buildplat[1] == 'win32' }} uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1 From c8c830ffbcbf79f6bd7edc52c75af76f7843c4d6 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 15:22:51 +0100 Subject: [PATCH 04/16] fix: run cibuildwheel directly on riscv64 to bypass actions/setup-python The cibuildwheel GitHub Action hardcodes actions/setup-python which has no pre-built Python for riscv64. On RISE runners, Python 3.12 is available at /opt/python-3.12/bin. Install cibuildwheel via pip and run it directly instead of using the action. Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index bded7b9af829..e9f4219f55d5 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -58,9 +58,8 @@ jobs: - name: Setup Python for riscv64 if: matrix.buildplat[1] == 'manylinux_riscv64' run: | - sudo apt-get update - sudo apt-get install -y python3 python3-pip python3-venv - echo "/usr/bin" >> "$GITHUB_PATH" + echo "/opt/python-3.12/bin" >> "$GITHUB_PATH" + /opt/python-3.12/bin/python3 -m pip install cibuildwheel==2.23.3 - name: Setup MSVC (32-bit) if: ${{ matrix.buildplat[1] == 'win32' }} @@ -107,10 +106,17 @@ jobs: fi - name: Build wheels + if: matrix.buildplat[1] != 'manylinux_riscv64' uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0 env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + - name: Build wheels (riscv64) + if: matrix.buildplat[1] == 'manylinux_riscv64' + run: cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }} From 772481686850127af1e539943aeb7c4fd4e1d50e Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 15:25:44 +0100 Subject: [PATCH 05/16] fix: auto-detect Python path on RISE runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /opt/python-3.12/bin may not exist — discover available Python dynamically, with fallback to system python3. Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e9f4219f55d5..99c445add2c9 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -58,8 +58,15 @@ jobs: - name: Setup Python for riscv64 if: matrix.buildplat[1] == 'manylinux_riscv64' run: | - echo "/opt/python-3.12/bin" >> "$GITHUB_PATH" - /opt/python-3.12/bin/python3 -m pip install cibuildwheel==2.23.3 + # Find available Python in /opt + PYTHON_PATH=$(ls -d /opt/python-3.*/bin 2>/dev/null | sort -V | tail -1) + if [ -z "$PYTHON_PATH" ]; then + # Fallback to system Python + PYTHON_PATH=$(dirname $(which python3)) + fi + echo "Using Python from: $PYTHON_PATH" + echo "$PYTHON_PATH" >> "$GITHUB_PATH" + "$PYTHON_PATH/python3" -m pip install cibuildwheel==2.23.3 - name: Setup MSVC (32-bit) if: ${{ matrix.buildplat[1] == 'win32' }} From 67099963654b1cd7012f81b5b525c6c76f452616 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 15:29:14 +0100 Subject: [PATCH 06/16] fix: try multiple Python paths on RISE runner Probe specific Python paths (/opt/python-3.12, 3.11, 3.13) and list directory contents for debugging. Avoids picking 3.14 which may have a different binary name. Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 99c445add2c9..fbaa7004b7c1 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -58,15 +58,20 @@ jobs: - name: Setup Python for riscv64 if: matrix.buildplat[1] == 'manylinux_riscv64' run: | - # Find available Python in /opt - PYTHON_PATH=$(ls -d /opt/python-3.*/bin 2>/dev/null | sort -V | tail -1) - if [ -z "$PYTHON_PATH" ]; then - # Fallback to system Python - PYTHON_PATH=$(dirname $(which python3)) + # Find a working Python 3 on the RISE runner + for py in /opt/python-3.12/bin/python3 /opt/python-3.12/bin/python3.12 /opt/python-3.11/bin/python3 /opt/python-3.13/bin/python3; do + if [ -x "$py" ]; then + PYTHON="$py" + break + fi + done + if [ -z "$PYTHON" ]; then + PYTHON=$(which python3 2>/dev/null || which python 2>/dev/null) fi - echo "Using Python from: $PYTHON_PATH" - echo "$PYTHON_PATH" >> "$GITHUB_PATH" - "$PYTHON_PATH/python3" -m pip install cibuildwheel==2.23.3 + echo "Using Python: $PYTHON" + ls -la "$(dirname "$PYTHON")/" + echo "$(dirname "$PYTHON")" >> "$GITHUB_PATH" + "$PYTHON" -m pip install cibuildwheel==2.23.3 - name: Setup MSVC (32-bit) if: ${{ matrix.buildplat[1] == 'win32' }} From b19e9c5d75bf85dddc4fdd7882cc35bb6a3591a0 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 15:32:04 +0100 Subject: [PATCH 07/16] fix: use python3 -m cibuildwheel instead of bare command 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 fbaa7004b7c1..d9472af7a57f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -125,7 +125,7 @@ jobs: - name: Build wheels (riscv64) if: matrix.buildplat[1] == 'manylinux_riscv64' - run: cibuildwheel --output-dir wheelhouse + run: python3 -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} From 744258afe0f71dcdfdd22a21f5a03fd237944230 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 15:33:54 +0100 Subject: [PATCH 08/16] fix: use /opt/python-3.12/bin/python3.12 on RISE runner Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d9472af7a57f..51eef6822e2c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -58,20 +58,8 @@ jobs: - name: Setup Python for riscv64 if: matrix.buildplat[1] == 'manylinux_riscv64' run: | - # Find a working Python 3 on the RISE runner - for py in /opt/python-3.12/bin/python3 /opt/python-3.12/bin/python3.12 /opt/python-3.11/bin/python3 /opt/python-3.13/bin/python3; do - if [ -x "$py" ]; then - PYTHON="$py" - break - fi - done - if [ -z "$PYTHON" ]; then - PYTHON=$(which python3 2>/dev/null || which python 2>/dev/null) - fi - echo "Using Python: $PYTHON" - ls -la "$(dirname "$PYTHON")/" - echo "$(dirname "$PYTHON")" >> "$GITHUB_PATH" - "$PYTHON" -m pip install cibuildwheel==2.23.3 + echo "/opt/python-3.12/bin" >> "$GITHUB_PATH" + /opt/python-3.12/bin/python3.12 -m pip install cibuildwheel==2.23.3 - name: Setup MSVC (32-bit) if: ${{ matrix.buildplat[1] == 'win32' }} From 40c8ab005a79055bdedc29cbff6a27c12721a774 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 15:40:11 +0100 Subject: [PATCH 09/16] fix: install cibuildwheel 3.4.0 (riscv64 native arch support) 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 51eef6822e2c..29a9266910c4 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -59,7 +59,7 @@ jobs: if: matrix.buildplat[1] == 'manylinux_riscv64' run: | echo "/opt/python-3.12/bin" >> "$GITHUB_PATH" - /opt/python-3.12/bin/python3.12 -m pip install cibuildwheel==2.23.3 + /opt/python-3.12/bin/python3.12 -m pip install cibuildwheel==3.4.0 - name: Setup MSVC (32-bit) if: ${{ matrix.buildplat[1] == 'win32' }} From 4443414fb42731bc7999d4e99ebf3cfd70b0dc67 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 16:38:42 +0100 Subject: [PATCH 10/16] ci: add ccache for riscv64 wheel builds Install and enable ccache inside the manylinux container to speed up subsequent C/C++ compilation. First build populates the cache, later builds benefit from cached object files. Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 29a9266910c4..e8cfc2f63e08 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -116,6 +116,8 @@ jobs: run: python3 -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_ENVIRONMENT: "CC='ccache gcc' CXX='ccache g++'" + CIBW_BEFORE_ALL: "yum install -y ccache || apt-get install -y ccache || true" - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: From 84325fa02d1b765669a097e429f917a8bfd108cd Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 16:46:31 +0100 Subject: [PATCH 11/16] fix: install scipy-openblas64 before building numpy wheel Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e8cfc2f63e08..ecca6d83e03e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -118,6 +118,7 @@ jobs: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} CIBW_ENVIRONMENT: "CC='ccache gcc' CXX='ccache g++'" CIBW_BEFORE_ALL: "yum install -y ccache || apt-get install -y ccache || true" + CIBW_BEFORE_BUILD: "pip install scipy-openblas64" - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: From b28b36986cd8682abc9a2061539fb76203254cca Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 17:03:12 +0100 Subject: [PATCH 12/16] fix: use manylinux_2_39 for riscv64 and let pyproject.toml handle openblas Remove CIBW overrides that conflict with pyproject.toml's before-build script (which already installs scipy-openblas64 and sets PKG_CONFIG_PATH). Add manylinux_2_39 image for riscv64 (2_28 has no riscv64 support). Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 3 --- pyproject.toml | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ecca6d83e03e..29a9266910c4 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -116,9 +116,6 @@ jobs: run: python3 -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - CIBW_ENVIRONMENT: "CC='ccache gcc' CXX='ccache g++'" - CIBW_BEFORE_ALL: "yum install -y ccache || apt-get install -y ccache || true" - CIBW_BEFORE_BUILD: "pip install scipy-openblas64" - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: diff --git a/pyproject.toml b/pyproject.toml index 732ab2741993..a508384b2249 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -202,6 +202,7 @@ build-dir = "build" [tool.cibuildwheel.linux] manylinux-x86_64-image = "manylinux_2_28" manylinux-aarch64-image = "manylinux_2_28" +manylinux-riscv64-image = "manylinux_2_39" musllinux-x86_64-image = "musllinux_1_2" musllinux-aarch64-image = "musllinux_1_2" From e679efff3655de28db84696f3335d407c73667e8 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 17:26:57 +0100 Subject: [PATCH 13/16] ci: use smoke test for riscv64 instead of full test suite The full pytest-xdist test suite has a known test collection ordering bug that fails on all platforms with multiple workers. Use a simple import + show_config smoke test for now. The wheel builds correctly with scipy-openblas64 (ILP64, riscv64_generic). Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 29a9266910c4..7fa3eefe49db 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -116,6 +116,7 @@ jobs: run: python3 -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_TEST_COMMAND: "python -c \"import numpy; print(numpy.__version__); numpy.show_config()\"" - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: From 310c4915853418119985c6fe9a6dd7729dc7d657 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 18:03:09 +0100 Subject: [PATCH 14/16] ci: add ccache for riscv64 wheel builds Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7fa3eefe49db..ed6e8052d95b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -111,11 +111,29 @@ jobs: env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + - name: Prepare ccache for riscv64 + if: matrix.buildplat[1] == 'manylinux_riscv64' + run: | + mkdir -p ${{ github.workspace }}/.ccache + echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> "$GITHUB_ENV" + + - name: Restore ccache for riscv64 + if: matrix.buildplat[1] == 'manylinux_riscv64' + uses: actions/cache@v4 + with: + path: .ccache + key: ccache-riscv64-${{ matrix.python }}-${{ hashFiles('numpy/**/*.c', 'numpy/**/*.h') }} + restore-keys: | + ccache-riscv64-${{ matrix.python }}- + - name: Build wheels (riscv64) if: matrix.buildplat[1] == 'manylinux_riscv64' run: python3 -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_BEFORE_ALL_LINUX: "yum install -y ccache || true" + CIBW_ENVIRONMENT_LINUX: "CC='ccache gcc' CXX='ccache g++' CCACHE_DIR=/host-ccache" + CIBW_CONTAINER_ENGINE: "docker; create_args: --volume=${{ github.workspace }}/.ccache:/host-ccache" CIBW_TEST_COMMAND: "python -c \"import numpy; print(numpy.__version__); numpy.show_config()\"" - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 From 576e4fb7e80d63f5ee813429c34f553f1278f073 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 18:25:27 +0100 Subject: [PATCH 15/16] revert: remove ccache that broke BLAS detection Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ed6e8052d95b..7fa3eefe49db 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -111,29 +111,11 @@ jobs: env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - - name: Prepare ccache for riscv64 - if: matrix.buildplat[1] == 'manylinux_riscv64' - run: | - mkdir -p ${{ github.workspace }}/.ccache - echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> "$GITHUB_ENV" - - - name: Restore ccache for riscv64 - if: matrix.buildplat[1] == 'manylinux_riscv64' - uses: actions/cache@v4 - with: - path: .ccache - key: ccache-riscv64-${{ matrix.python }}-${{ hashFiles('numpy/**/*.c', 'numpy/**/*.h') }} - restore-keys: | - ccache-riscv64-${{ matrix.python }}- - - name: Build wheels (riscv64) if: matrix.buildplat[1] == 'manylinux_riscv64' run: python3 -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - CIBW_BEFORE_ALL_LINUX: "yum install -y ccache || true" - CIBW_ENVIRONMENT_LINUX: "CC='ccache gcc' CXX='ccache g++' CCACHE_DIR=/host-ccache" - CIBW_CONTAINER_ENGINE: "docker; create_args: --volume=${{ github.workspace }}/.ccache:/host-ccache" CIBW_TEST_COMMAND: "python -c \"import numpy; print(numpy.__version__); numpy.show_config()\"" - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 From eb9d44b8a834b155abbc95db28083f23379551ed Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 19:38:07 +0100 Subject: [PATCH 16/16] ci: add ccache for riscv64 without overriding pyproject.toml env Use symlink-based ccache (ln -sf ccache /usr/local/bin/gcc) instead of CIBW_ENVIRONMENT_LINUX which clobbers PKG_CONFIG_PATH and RUNNER_OS needed for openblas detection. Mount ccache dir via CIBW_CONTAINER_ENGINE. Signed-off-by: Bruno Verachten --- .github/workflows/wheels.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7fa3eefe49db..416b0dc35f46 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -111,11 +111,29 @@ jobs: env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + - name: Restore ccache for riscv64 + if: matrix.buildplat[1] == 'manylinux_riscv64' + uses: actions/cache@v4 + with: + path: .ccache + key: ccache-riscv64-${{ matrix.python }}-${{ github.sha }} + restore-keys: | + ccache-riscv64-${{ matrix.python }}- + - name: Build wheels (riscv64) if: matrix.buildplat[1] == 'manylinux_riscv64' - run: python3 -m cibuildwheel --output-dir wheelhouse + run: | + mkdir -p ${{ github.workspace }}/.ccache + python3 -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_BEFORE_ALL_LINUX: > + yum install -y ccache || true && + ln -sf $(which ccache) /usr/local/bin/gcc && + ln -sf $(which ccache) /usr/local/bin/g++ && + ln -sf $(which ccache) /usr/local/bin/cc && + ln -sf $(which ccache) /usr/local/bin/c++ + CIBW_CONTAINER_ENGINE: "docker; create_args: --volume=${{ github.workspace }}/.ccache:/root/.cache/ccache" CIBW_TEST_COMMAND: "python -c \"import numpy; print(numpy.__version__); numpy.show_config()\"" - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0