From bfd484816e9096067e8f9d598ec7839c00080a7c Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 13 Oct 2026 17:18:10 +0000 Subject: [PATCH 1/2] bermuda: add riscv64 build (0.1.7) pyo3/setuptools-rust extension for napari's polygon/mesh triangulation ops. Thin wrapper around upstream's own cibuildwheel config (rust install, test command/groups already declared in pyproject.toml); only the riscv64 manylinux image and a setuptools_scm pretend-version (this checkout carries no tags) are added. Verified locally on x86_64: builds and its own 64-test suite passes against the built wheel. --- .github/workflows/build-bermuda.yml | 101 ++++++++++++++++++++++++++++ docs/packages/bermuda.yaml | 5 ++ 2 files changed, 106 insertions(+) create mode 100644 .github/workflows/build-bermuda.yml create mode 100644 docs/packages/bermuda.yaml diff --git a/.github/workflows/build-bermuda.yml b/.github/workflows/build-bermuda.yml new file mode 100644 index 000000000000..3b632457ec41 --- /dev/null +++ b/.github/workflows/build-bermuda.yml @@ -0,0 +1,101 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on the `build_wheels` job of +# https://github.com/napari/bermuda/blob/v0.1.7/.github/workflows/wheels.yml +name: Build bermuda wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/bermuda.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-bermuda.yml' + - 'docs/packages/bermuda.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-bermuda.yml' + - 'docs/packages/bermuda.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: bermuda + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build bermuda ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # Per-interpreter (not abi3): pyo3's extension-module binding has no + # abi3 feature enabled here. + python: ["cp312", "cp313", "cp314", "cp314t"] + + env: + BERMUDA_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout bermuda v${{ env.BERMUDA_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: napari/bermuda + ref: v${{ env.BERMUDA_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + only: ${{ matrix.python }}-manylinux_riscv64 + env: + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # setuptools_scm can't derive the version from this tag-less checkout. + CIBW_ENVIRONMENT: >- + PATH=$HOME/.cargo/bin:$PATH + SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BERMUDA=${{ env.BERMUDA_VERSION }} + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: bermuda-${{ env.BERMUDA_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish bermuda ${{ matrix.version }} + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + secrets: + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} + with: + artifact-pattern: bermuda-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/bermuda.yaml b/docs/packages/bermuda.yaml new file mode 100644 index 000000000000..b497fb830bc2 --- /dev/null +++ b/docs/packages/bermuda.yaml @@ -0,0 +1,5 @@ +package-name: bermuda +source-code: https://github.com/napari/bermuda +license: BSD-3-Clause +versions: +- version: 0.1.7 From 4fa4fd668643a3dad6aa444c91fb830267809e90 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sun, 25 Oct 2026 17:56:16 +0000 Subject: [PATCH 2/2] bermuda: patch cibuildwheel's removed cpython-freethreading enable group Every build leg (cp312/cp313/cp314/cp314t) fails identically in seconds with "cibuildwheel: Failed to parse enable group. Unknown enable group: cpython-freethreading" -- cibuildwheel 4.2.0, which this repo pins, dropped that enable option; upstream's own pyproject.toml still carries it because it was written against their older pinned cibuildwheel (3.4.1 at the v0.1.7 tag). The whole [tool.cibuildwheel] table is parsed up front, so --only never narrows around the bad value. Carry the same one-line fix upstream already shipped in a later commit (dropping the token outright, no replacement) as a patch applied right after checkout, same mechanics as patches/pi-heif. --- .github/workflows/build-bermuda.yml | 11 +++++++ ...d-cpython-freethreading-enable-group.patch | 31 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 patches/bermuda/0.1.7/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch diff --git a/.github/workflows/build-bermuda.yml b/.github/workflows/build-bermuda.yml index 3b632457ec41..13f84ac3ed11 100644 --- a/.github/workflows/build-bermuda.yml +++ b/.github/workflows/build-bermuda.yml @@ -17,11 +17,13 @@ on: paths: - '.github/workflows/build-bermuda.yml' - 'docs/packages/bermuda.yaml' + - 'patches/bermuda/**' push: branches: [main] paths: - '.github/workflows/build-bermuda.yml' - 'docs/packages/bermuda.yaml' + - 'patches/bermuda/**' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -65,6 +67,15 @@ jobs: ref: v${{ env.BERMUDA_VERSION }} persist-credentials: false + - name: Checkout python-wheels + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: python-wheels + persist-credentials: false + + - name: Patch bermuda source + run: git apply python-wheels/patches/bermuda/${{ env.BERMUDA_VERSION }}/*.patch + - name: Build wheels uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 with: diff --git a/patches/bermuda/0.1.7/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch b/patches/bermuda/0.1.7/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch new file mode 100644 index 000000000000..a2b838448489 --- /dev/null +++ b/patches/bermuda/0.1.7/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Thu, 14 Oct 2026 12:00:00 +0000 +Subject: [PATCH] pyproject: drop the removed cpython-freethreading enable + group + +cibuildwheel 4.2.0 (the version this repo pins for riscv64 builds) no +longer recognises "cpython-freethreading" as an enable group -- it +errors "Failed to parse enable group" before any build starts, on +every interpreter, since the whole [tool.cibuildwheel] table is parsed +up front and `--only ` does not narrow around it. Free-threaded +builds (cp314t) no longer need an opt-in on this cibuildwheel version. + +Upstream-Status: Backport [https://github.com/napari/bermuda/commit/a73b76c35aabc693cd7996dfe66d8ead7dbb759f] +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 7f24c3b..7a8f083 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -163,7 +163,7 @@ combine-as-imports = true + [tool.cibuildwheel] + test-command = "pytest {project}/tests" + test-groups = ["test"] +-enable = ["pypy", "cpython-freethreading"] ++enable = ["pypy"] + build = "*64" + + [tool.cibuildwheel.linux]