From 17c7decbef4a7ee4f39aeeafd3c856ddbcb1db4d Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 22:00:26 +0100 Subject: [PATCH 1/4] ci: add native riscv64 wheel builds using RISE runners Signed-off-by: Bruno Verachten --- .github/workflows/wheel-builder.yml | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/wheel-builder.yml b/.github/workflows/wheel-builder.yml index 52af63b1..2ef73650 100644 --- a/.github/workflows/wheel-builder.yml +++ b/.github/workflows/wheel-builder.yml @@ -127,6 +127,42 @@ jobs: name: "bcrypt-${{ github.event.inputs.version }}-${{ matrix.MANYLINUX.NAME }}-${{ matrix.PYTHON.VERSION }}${{ matrix.PYTHON.ABI_VERSION }}" path: bcrypt-wheelhouse/ + manylinux-riscv64: + needs: [sdist] + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + PYTHON: + - { VERSION: "cp39-cp39", ABI_VERSION: "" } + - { VERSION: "cp312-cp312", ABI_VERSION: "" } + name: "${{ matrix.PYTHON.VERSION }} for manylinux_riscv64" + steps: + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y python3-dev python3-venv python3-pip patchelf rustc cargo libffi-dev + - run: python3 -m venv .venv + - name: Install python dependencies + run: .venv/bin/pip install -U pip wheel setuptools-rust auditwheel + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c + with: + name: bcrypt-sdist + - run: mkdir tmpwheelhouse + - name: Build the wheel + run: | + .venv/bin/python -m pip wheel -v bcrypt*.tar.gz -w dist/ && mv dist/bcrypt*.whl tmpwheelhouse + - run: auditwheel repair tmpwheelhouse/bcrypt*.whl -w wheelhouse/ + - run: .venv/bin/pip install bcrypt --no-index -f wheelhouse/ + - run: | + .venv/bin/python -c "import bcrypt; password = b'super secret password';hashed = bcrypt.hashpw(password, bcrypt.gensalt());bcrypt.checkpw(password, hashed)" + - run: mkdir bcrypt-wheelhouse + - run: mv wheelhouse/bcrypt*.whl bcrypt-wheelhouse/ + - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f + with: + name: "bcrypt-${{ github.event.inputs.version }}-manylinux_riscv64-${{ matrix.PYTHON.VERSION }}" + path: bcrypt-wheelhouse/ + macos: needs: [sdist] runs-on: macos-15 From 2c7f6c5115148fbdf8630f7616606c59d3a3ef17 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 22:04:28 +0100 Subject: [PATCH 2/4] fix: use /opt/python-3.12 and rustup on RISE runner Signed-off-by: Bruno Verachten --- .github/workflows/wheel-builder.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheel-builder.yml b/.github/workflows/wheel-builder.yml index 2ef73650..c230f286 100644 --- a/.github/workflows/wheel-builder.yml +++ b/.github/workflows/wheel-builder.yml @@ -141,8 +141,10 @@ jobs: - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install -y python3-dev python3-venv python3-pip patchelf rustc cargo libffi-dev - - run: python3 -m venv .venv + sudo apt-get install -y patchelf libffi-dev + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + - run: /opt/python-3.12/bin/python3.12 -m venv .venv - name: Install python dependencies run: .venv/bin/pip install -U pip wheel setuptools-rust auditwheel - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c From 719924e35de5cf844dc8678cdc8174c52997403f Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 22:19:00 +0100 Subject: [PATCH 3/4] fix: use .venv/bin/auditwheel on RISE runner Signed-off-by: Bruno Verachten --- .github/workflows/wheel-builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheel-builder.yml b/.github/workflows/wheel-builder.yml index c230f286..9bc7bdbe 100644 --- a/.github/workflows/wheel-builder.yml +++ b/.github/workflows/wheel-builder.yml @@ -154,7 +154,7 @@ jobs: - name: Build the wheel run: | .venv/bin/python -m pip wheel -v bcrypt*.tar.gz -w dist/ && mv dist/bcrypt*.whl tmpwheelhouse - - run: auditwheel repair tmpwheelhouse/bcrypt*.whl -w wheelhouse/ + - run: .venv/bin/auditwheel repair tmpwheelhouse/bcrypt*.whl -w wheelhouse/ - run: .venv/bin/pip install bcrypt --no-index -f wheelhouse/ - run: | .venv/bin/python -c "import bcrypt; password = b'super secret password';hashed = bcrypt.hashpw(password, bcrypt.gensalt());bcrypt.checkpw(password, hashed)" From 45b5a7bc1deec3f1e11edbd94238c192c394d2b8 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 18 Mar 2026 22:32:17 +0100 Subject: [PATCH 4/4] ci: cache Rust cargo registry for riscv64 builds Signed-off-by: Bruno Verachten --- .github/workflows/wheel-builder.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/wheel-builder.yml b/.github/workflows/wheel-builder.yml index 9bc7bdbe..e8f3cf53 100644 --- a/.github/workflows/wheel-builder.yml +++ b/.github/workflows/wheel-builder.yml @@ -144,6 +144,15 @@ jobs: sudo apt-get install -y patchelf libffi-dev curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + - name: Cache Rust artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + key: bcrypt-riscv64-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + bcrypt-riscv64-cargo- - run: /opt/python-3.12/bin/python3.12 -m venv .venv - name: Install python dependencies run: .venv/bin/pip install -U pip wheel setuptools-rust auditwheel