From d00a8fc098019a35a0a564ce4160156d44d69900 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 7 Sep 2026 06:40:14 +0200 Subject: [PATCH 1/3] cyksuid: add build-cyksuid.yml for riscv64 wheels Cython/C++ KSUID binding with no runtime dependencies; upstream ships no riscv64 wheel. Mirrors the `wheel` job of upstream's wheels.yml, cythonizing in-container since the tagged checkout has no pre-generated .cpp sources. --- .github/workflows/build-cyksuid.yml | 87 +++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/build-cyksuid.yml diff --git a/.github/workflows/build-cyksuid.yml b/.github/workflows/build-cyksuid.yml new file mode 100644 index 000000000..33bca9946 --- /dev/null +++ b/.github/workflows/build-cyksuid.yml @@ -0,0 +1,87 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on the `wheel` job of +# https://github.com/timonwong/cyksuid/blob/v2.1.0/.github/workflows/wheels.yml +name: Build cyksuid wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'cyksuid version to build (git tag without leading v, e.g. 2.1.0)' + required: true + default: '2.1.0' + pull_request: + paths: + - '.github/workflows/build-cyksuid.yml' + +concurrency: + group: ${{ github.workflow }}-${{ inputs.version || '2.1.0' }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + CYKSUID_VERSION: ${{ inputs.version || '2.1.0' }} + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + + build_wheels: + needs: [setup] + name: Build cyksuid ${{ inputs.version || '2.1.0' }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + python: ["cp312", "cp313", "cp314", "cp314t"] + + steps: + - name: Checkout cyksuid v${{ env.CYKSUID_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: timonwong/cyksuid + ref: v${{ env.CYKSUID_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 }} + # pyproject.toml's build-system.requires omits Cython, and setup.py only + # cythonizes the .pyx sources when CYTHON=1 is set (upstream's own CI sets + # this via `--with-cython` before running cibuildwheel); the tagged repo + # ships no pre-generated .cpp, so both are needed here. + CIBW_BEFORE_BUILD: pip install "cython==3.0.10" setuptools + CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" + CIBW_ENVIRONMENT: CYTHON=1 + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: >- + python -c "from cyksuid import _ksuid, fast_base62; + m = [_ksuid, fast_base62]; + bad = [x.__name__ for x in m if not x.__file__.endswith('.so')]; + assert not bad, bad" + && python -m pytest {project}/tests -v + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: cyksuid-${{ env.CYKSUID_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish cyksuid ${{ inputs.version || '2.1.0' }} + needs: [setup, build_wheels] + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + with: + artifact-pattern: cyksuid-${{ inputs.version || '2.1.0' }}-*-manylinux_riscv64 From bb976d332590ef5660d6be8d4532835112a502b0 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 7 Sep 2026 10:46:04 +0200 Subject: [PATCH 2/3] cyksuid: fix cibuildwheel 4.x rejecting upstream's musllinux_1_1 alias --only expands to all Linux arches for config validation, so upstream pyproject.toml's musllinux-*-image = "musllinux_1_1" (a bare alias cibuildwheel 4.x rejects) fails config parsing even though only riscv64 is ever actually built. Override the three non-riscv64 musllinux images to a supported alias. --- .github/workflows/build-cyksuid.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build-cyksuid.yml b/.github/workflows/build-cyksuid.yml index 33bca9946..a4d9675e7 100644 --- a/.github/workflows/build-cyksuid.yml +++ b/.github/workflows/build-cyksuid.yml @@ -55,6 +55,13 @@ jobs: only: ${{ matrix.python }}-manylinux_riscv64 env: CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # `--only` makes cibuildwheel validate every Linux arch's configured image, not + # just riscv64's; pyproject.toml's musllinux-*-image = "musllinux_1_1" is a bare + # alias cibuildwheel 4.x rejects outright, so it must be overridden even though + # these arches are never built here. + CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2 + CIBW_MUSLLINUX_I686_IMAGE: musllinux_1_2 + CIBW_MUSLLINUX_AARCH64_IMAGE: musllinux_1_2 # pyproject.toml's build-system.requires omits Cython, and setup.py only # cythonizes the .pyx sources when CYTHON=1 is set (upstream's own CI sets # this via `--with-cython` before running cibuildwheel); the tagged repo From b9c6e26c98dd1ed4b76a3d5ed3b53fcf22d1c15b Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 7 Sep 2026 12:33:20 +0200 Subject: [PATCH 3/3] cyksuid: bump Cython to 3.3.0 to compile under cp314t Upstream pins cython==3.0.10, which predates free-threaded support: the generated fast_base62.cpp references __pyx_vectorcallfunc, which isn't declared under the nogil build, so g++ fails with "has not been declared". Bumped past that pin; verified locally that the resulting wheel builds and the full test suite still passes. --- .github/workflows/build-cyksuid.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cyksuid.yml b/.github/workflows/build-cyksuid.yml index a4d9675e7..eedbc9e80 100644 --- a/.github/workflows/build-cyksuid.yml +++ b/.github/workflows/build-cyksuid.yml @@ -65,8 +65,11 @@ jobs: # pyproject.toml's build-system.requires omits Cython, and setup.py only # cythonizes the .pyx sources when CYTHON=1 is set (upstream's own CI sets # this via `--with-cython` before running cibuildwheel); the tagged repo - # ships no pre-generated .cpp, so both are needed here. - CIBW_BEFORE_BUILD: pip install "cython==3.0.10" setuptools + # ships no pre-generated .cpp, so both are needed here. Upstream's own + # tools/wheel-requirements.txt pins cython==3.0.10, but that predates + # free-threaded support and can't compile under cp314t (unbound + # __pyx_vectorcallfunc); bumped to build across the whole matrix. + CIBW_BEFORE_BUILD: pip install "cython==3.3.0" setuptools CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_ENVIRONMENT: CYTHON=1 CIBW_TEST_REQUIRES: pytest