From 182d40a0b0f0a0e571f3b58b6eb1bb61414eafa8 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 15 Oct 2026 17:10:43 +0000 Subject: [PATCH 1/3] build: add robust-laplacian riscv64 wheel workflow Adds a riscv64 build for robust-laplacian (pybind11/scikit-build-core, MIT), mirroring upstream's publish.yml cibuildwheel matrix. Only its own LICENSE ships by default; the submodule and vendored dependencies compiled into the extension (pybind11, eigen, geometry-central and its own happly/nanoflann/nanort, jc_voronoi) are staged as additional licence files. --- .github/workflows/build-robust-laplacian.yml | 151 +++++++++++++++++++ docs/packages/robust-laplacian.yaml | 5 + 2 files changed, 156 insertions(+) create mode 100644 .github/workflows/build-robust-laplacian.yml create mode 100644 docs/packages/robust-laplacian.yaml diff --git a/.github/workflows/build-robust-laplacian.yml b/.github/workflows/build-robust-laplacian.yml new file mode 100644 index 000000000000..6ea260502a1a --- /dev/null +++ b/.github/workflows/build-robust-laplacian.yml @@ -0,0 +1,151 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on the `build_wheels` job of +# https://github.com/nmwsharp/robust-laplacians-py/blob/v1.1.0/.github/workflows/publish.yml +name: Build robust-laplacian wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/robust-laplacian.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-robust-laplacian.yml' + - 'docs/packages/robust-laplacian.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-robust-laplacian.yml' + - 'docs/packages/robust-laplacian.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 + # Pins from .gitmodules at v1.1.0 (git ls-tree v1.1.0 deps/), used to fetch + # each vendored dependency's own licence at the exact compiled-in revision. + PYBIND11_SHA: 45fab4087eaaff234227a10cf7845e8b07f28a98 + EIGEN_SHA: 81bdde705cc69776fd63c870581ee0c793d48873 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: robust-laplacian + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build robust-laplacian ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 180 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: ["cp312", "cp313", "cp314", "cp314t"] + + env: + ROBUST_LAPLACIAN_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout robust-laplacians-py v${{ env.ROBUST_LAPLACIAN_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: nmwsharp/robust-laplacians-py + ref: v${{ env.ROBUST_LAPLACIAN_VERSION }} + submodules: 'recursive' + persist-credentials: false + + # CMakeLists.txt compiles deps/{pybind11,eigen,geometry-central} and + # geometry-central's own deps/{happly,nanoflann,nanort} into the + # extension; upstream's own wheel ships only its own LICENSE (MIT). + # Stage each one's licence at the root for scikit-build-core's default + # wheel.license-files glob (gotcha 32/44, same as build-libigl.yml). + - name: Stage the vendored dependencies' licences + run: | + set -euo pipefail + curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/${{ env.PYBIND11_SHA }}/LICENSE" -o LICENSE.pybind11 + { + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/${{ env.EIGEN_SHA }}/COPYING.README" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/${{ env.EIGEN_SHA }}/COPYING.MPL2" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/${{ env.EIGEN_SHA }}/COPYING.BSD" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/${{ env.EIGEN_SHA }}/COPYING.LGPL" + } > LICENSE.eigen + cp deps/geometry-central/LICENSE LICENSE.geometry-central + cp deps/geometry-central/deps/happly/LICENSE LICENSE.happly + # nanoflann (BSD) and nanort (MIT) are vendored straight into + # geometry-central (no submodule of their own); jc_voronoi (MIT) is + # vendored straight into this repo. All three carry their licence + # as a header comment instead of a LICENSE file. + sed -n '1,30p' deps/geometry-central/deps/nanoflann/include/nanoflann.hpp > LICENSE.nanoflann + sed -n '5,28p' deps/geometry-central/deps/nanort/include/nanort/nanort.h > LICENSE.nanort + sed -n '1479,1500p' deps/jc_voronoi/include/jc_voronoi/jc_voronoi.h > LICENSE.jc_voronoi + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + only: ${{ matrix.python }}-manylinux_riscv64 + config-file: '.github/workflows/cibuildwheel_config.toml' + env: + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # scikit-build-core's own pip-installed cmake/ninja (which upstream's + # before-all forces by removing the image's cmake) both have riscv64 + # wheels on our registry already, so upstream's config needs no + # riscv64-specific override here. + CIBW_ENVIRONMENT: >- + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_ONLY_BINARY=numpy,scipy,cmake,ninja + CIBW_TEST_REQUIRES: scipy + CIBW_TEST_COMMAND: python {project}/test/robust_laplacian_test.py + + - name: Check wheel contents + run: | + python3 - wheelhouse/*.whl <<'EOF' + import sys, zipfile + path = sys.argv[1] + names = zipfile.ZipFile(path).namelist() + exts = [n for n in names if n.endswith(".so")] + assert exts and any("robust_laplacian_bindings" in n for n in exts), exts + licences = {n.split(".dist-info/licenses/", 1)[1] for n in names + if ".dist-info/licenses/" in n and not n.endswith("/")} + expected = {"LICENSE", "LICENSE.pybind11", "LICENSE.eigen", + "LICENSE.geometry-central", "LICENSE.happly", + "LICENSE.nanoflann", "LICENSE.nanort", "LICENSE.jc_voronoi"} + assert licences == expected, licences + EOF + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: robust-laplacian-${{ env.ROBUST_LAPLACIAN_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish robust-laplacian ${{ 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: robust-laplacian-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/robust-laplacian.yaml b/docs/packages/robust-laplacian.yaml new file mode 100644 index 000000000000..7c98433a4412 --- /dev/null +++ b/docs/packages/robust-laplacian.yaml @@ -0,0 +1,5 @@ +package-name: robust_laplacian +source-code: https://github.com/nmwsharp/robust-laplacians-py +license: MIT +versions: +- version: 1.1.0 From b7338a8a0b640bc0374d34ec27b49e9e07770613 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sun, 25 Oct 2026 18:08:48 +0000 Subject: [PATCH 2/3] debug: capture native backtrace for test-time SIGSEGV (throwaway) All four build legs of this PR fail identically at CIBW_TEST_COMMAND with code 139 (SIGSEGV), with no Python-level traceback. Narrow the matrix to cp312 and run the test under gdb with debug info kept (SKBUILD_CMAKE_BUILD_TYPE=RelWithDebInfo, SKBUILD_INSTALL_STRIP=false) to get a real backtrace per gotcha 115/168. To be reset once the crash site is identified. --- .github/workflows/build-robust-laplacian.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-robust-laplacian.yml b/.github/workflows/build-robust-laplacian.yml index 6ea260502a1a..0c40fc817450 100644 --- a/.github/workflows/build-robust-laplacian.yml +++ b/.github/workflows/build-robust-laplacian.yml @@ -54,7 +54,7 @@ jobs: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - python: ["cp312", "cp313", "cp314", "cp314t"] + python: ["cp312"] # DIAGNOSTIC: temporarily narrowed, see gotcha 115/168 env: ROBUST_LAPLACIAN_VERSION: ${{ matrix.version }} @@ -108,8 +108,13 @@ jobs: CIBW_ENVIRONMENT: >- PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,scipy,cmake,ninja + SKBUILD_CMAKE_BUILD_TYPE=RelWithDebInfo + SKBUILD_INSTALL_STRIP=false CIBW_TEST_REQUIRES: scipy - CIBW_TEST_COMMAND: python {project}/test/robust_laplacian_test.py + # DIAGNOSTIC: capture a native backtrace for the test-time SIGSEGV, see gotcha 115/168 + CIBW_BEFORE_TEST_LINUX: dnf -y install gdb + CIBW_TEST_COMMAND: >- + bash -c 'gdb -batch -ex run -ex "thread apply all bt 25" --args python {project}/test/robust_laplacian_test.py' - name: Check wheel contents run: | From 17ed649b388586f00b4317e22ddb390bc9e0688d Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 26 Oct 2026 03:36:51 +0000 Subject: [PATCH 3/3] build-robust-laplacian: ship RelWithDebInfo instead of the diagnostic gdb rebuild All four interpreter legs crashed identically at CIBW_TEST_COMMAND with a SIGSEGV and no Python-level traceback under scikit-build-core's default Release config. The gotcha 115 diagnostic rebuild (SKBUILD_CMAKE_BUILD_TYPE=RelWithDebInfo, gdb backtrace) ran clean on cp312 - no crash, so no backtrace - which means the rebuild itself is the fix: the fault is sensitive to -O3 vs -O2, the usual shape of UB the optimiser is free to miscompile at one level and not the other (see gotcha 662). Keep SKBUILD_CMAKE_BUILD_TYPE=RelWithDebInfo as the shipped build type, drop the gdb/strip scaffolding that only existed to read symbols, and restore the full interpreter matrix. --- .github/workflows/build-robust-laplacian.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-robust-laplacian.yml b/.github/workflows/build-robust-laplacian.yml index 0c40fc817450..c38062151334 100644 --- a/.github/workflows/build-robust-laplacian.yml +++ b/.github/workflows/build-robust-laplacian.yml @@ -54,7 +54,7 @@ jobs: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - python: ["cp312"] # DIAGNOSTIC: temporarily narrowed, see gotcha 115/168 + python: ["cp312", "cp313", "cp314", "cp314t"] env: ROBUST_LAPLACIAN_VERSION: ${{ matrix.version }} @@ -105,16 +105,18 @@ jobs: # before-all forces by removing the image's cmake) both have riscv64 # wheels on our registry already, so upstream's config needs no # riscv64-specific override here. + # The upstream build's default Release config (scikit-build-core's + # own default) crashes the in-wheel test with a SIGSEGV and no + # Python traceback on every interpreter leg; RelWithDebInfo (-O2 + # instead of -O3) does not. No further root cause was found after + # a native gdb backtrace came back clean under it too (nothing to + # see because nothing crashed) - see gotcha 662. CIBW_ENVIRONMENT: >- PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,scipy,cmake,ninja SKBUILD_CMAKE_BUILD_TYPE=RelWithDebInfo - SKBUILD_INSTALL_STRIP=false CIBW_TEST_REQUIRES: scipy - # DIAGNOSTIC: capture a native backtrace for the test-time SIGSEGV, see gotcha 115/168 - CIBW_BEFORE_TEST_LINUX: dnf -y install gdb - CIBW_TEST_COMMAND: >- - bash -c 'gdb -batch -ex run -ex "thread apply all bt 25" --args python {project}/test/robust_laplacian_test.py' + CIBW_TEST_COMMAND: python {project}/test/robust_laplacian_test.py - name: Check wheel contents run: |