From d40b6e818f164cc6305b01fc7d52d68af1242c23 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 7 Sep 2026 14:07:12 +0200 Subject: [PATCH 1/2] ncompress: add build-ncompress.yml for riscv64 wheels --- .github/workflows/build-ncompress.yml | 89 +++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/build-ncompress.yml diff --git a/.github/workflows/build-ncompress.yml b/.github/workflows/build-ncompress.yml new file mode 100644 index 000000000..59d20877d --- /dev/null +++ b/.github/workflows/build-ncompress.yml @@ -0,0 +1,89 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# Based on upstream's own wheel build: +# https://github.com/valgur/ncompress/blob/v1.0.2/.github/workflows/publish.yml +name: Build ncompress wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'ncompress version/tag to build (git tag without leading v, e.g. 1.0.2)' + required: true + default: '1.0.2' + pull_request: + paths: + - '.github/workflows/build-ncompress.yml' + +concurrency: + group: ${{ github.workflow }}-${{ inputs.version || '1.0.2' }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + NCOMPRESS_VERSION: ${{ inputs.version || '1.0.2' }} + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + MUSLLINUX_RISCV64_IMAGE: quay.io/pypa/musllinux_1_2_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + + build_wheels: + needs: [setup] + name: Build ncompress ${{ inputs.version || '1.0.2' }} ${{ matrix.python }}-${{ matrix.libc }}_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + # cp312 wheel is abi3, so only cp314t needs a separate build + python: ["cp312", "cp314t"] + libc: [manylinux, musllinux] + + steps: + - name: Checkout ncompress v${{ env.NCOMPRESS_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: valgur/ncompress + ref: v${{ env.NCOMPRESS_VERSION }} + persist-credentials: false + + - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + env: + CIBW_ARCHS: riscv64 + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.libc }}_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} + + - 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 all("ncompress_core" 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("/")} + assert licences == {"LICENSE"}, licences + EOF + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ncompress-${{ env.NCOMPRESS_VERSION }}-${{ matrix.python }}-${{ matrix.libc }}_riscv64 + path: ./wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish ncompress ${{ inputs.version || '1.0.2' }} + needs: [setup, build_wheels] + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + with: + artifact-pattern: ncompress-${{ inputs.version || '1.0.2' }}-*riscv64 From 2816cad02f952e65478e686cd02aba79c62325c5 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 7 Sep 2026 14:28:47 +0200 Subject: [PATCH 2/2] ncompress: patch cmake.minimum-version -> cmake.version, apply in CI Fixes "ERROR: Use cmake.version instead of cmake.minimum-version with scikit-build-core >= 0.8" - pyproject.toml's build-system.requires floors scikit-build-core at >=0.4.3 with no upper bound, so an isolated build always resolves the newest release, which removed the old key outright at 0.8.0. Reproduces on any architecture. --- .github/workflows/build-ncompress.yml | 13 ++++++ ...use-cmake.version-instead-of-cmake.m.patch | 41 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 patches/ncompress/1.0.2/0001-pyproject.toml-use-cmake.version-instead-of-cmake.m.patch diff --git a/.github/workflows/build-ncompress.yml b/.github/workflows/build-ncompress.yml index 59d20877d..379e31249 100644 --- a/.github/workflows/build-ncompress.yml +++ b/.github/workflows/build-ncompress.yml @@ -15,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/build-ncompress.yml' + - 'patches/ncompress/**' concurrency: group: ${{ github.workflow }}-${{ inputs.version || '1.0.2' }}-${{ github.head_ref || github.run_id }} @@ -52,6 +53,18 @@ jobs: ref: v${{ env.NCOMPRESS_VERSION }} persist-credentials: false + - name: Checkout python-wheels + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: python-wheels + persist-credentials: false + + # pyproject.toml's build-system.requires floors scikit-build-core at + # >=0.4.3 with no upper bound; 0.8+ removed cmake.minimum-version outright, + # so an isolated build always fails on any architecture. + - name: Patch ncompress source + run: git apply python-wheels/patches/ncompress/${{ env.NCOMPRESS_VERSION }}/00*.patch + - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 env: CIBW_ARCHS: riscv64 diff --git a/patches/ncompress/1.0.2/0001-pyproject.toml-use-cmake.version-instead-of-cmake.m.patch b/patches/ncompress/1.0.2/0001-pyproject.toml-use-cmake.version-instead-of-cmake.m.patch new file mode 100644 index 000000000..cbc0c28fc --- /dev/null +++ b/patches/ncompress/1.0.2/0001-pyproject.toml-use-cmake.version-instead-of-cmake.m.patch @@ -0,0 +1,41 @@ +From 582eab15369516c8e0c6ddac0d1be404f2624fe1 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Mon, 7 Sep 2026 14:27:18 +0200 +Subject: [PATCH] pyproject.toml: use cmake.version instead of + cmake.minimum-version + +scikit-build-core removed the cmake.minimum-version config key +outright at 0.8.0 in favour of cmake.version. pyproject.toml's +build-system.requires only floors scikit-build-core at >=0.4.3 with +no upper bound, so an isolated build always resolves the newest +release and dies at "Getting requirements to build wheel" with: + + ERROR: Use cmake.version instead of cmake.minimum-version with + scikit-build-core >= 0.8 + +Reproduces on any architecture (confirmed on macOS/arm64): this is a +packaging defect in the 1.0.2 release, not a riscv64 gap. +scikit-build-core reads cmake.version the same way +cmake.minimum-version was read. + +Upstream-Status: To upstream [not filed against valgur/ncompress from this automated port; a maintainer should report it upstream] +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index e0b8b74..6c65046 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -41,7 +41,7 @@ build-backend = "scikit_build_core.build" + # after editing C++ files. + + [tool.scikit-build] +-cmake.minimum-version = "3.18" ++cmake.version = ">=3.18" + wheel.license-files = ["LICENSE"] + build-dir = "build/{wheel_tag}" + # Build stable ABI wheels for CPython 3.12+ +-- +2.50.1 (Apple Git-155) +