From 716a81000489f7da737f612d0f995102b1fb0abf Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Tue, 14 Jul 2026 18:10:00 +0200 Subject: [PATCH 1/3] zstandard: build wheels for riscv64 Add a riscv64 wheel build for zstandard, modeled on build-numpy.yml, and register the package in ci_scripts/packages.txt. zstandard ships no riscv64 wheels on PyPI (0.25.0 covers every arch except riscv64) and is a common dependency, so riscv64 users build it from source today. riscv64 specifics: - CIBW_BUILD restricted to -manylinux_riscv64 (musl skipped by construction). - CIBW_BUILD_FRONTEND forced to `build`: upstream pins `build[uv]` in pyproject.toml, which fails on riscv64 because uv is absent from the manylinux_riscv64 image. - Checkout ref is the bare version, since zstandard tags are not v-prefixed. Signed-off-by: Bruno Verachten --- .github/workflows/build-zstandard.yml | 104 ++++++++++++++++++++++++++ ci_scripts/packages.txt | 1 + 2 files changed, 105 insertions(+) create mode 100644 .github/workflows/build-zstandard.yml diff --git a/.github/workflows/build-zstandard.yml b/.github/workflows/build-zstandard.yml new file mode 100644 index 0000000..59bd2cc --- /dev/null +++ b/.github/workflows/build-zstandard.yml @@ -0,0 +1,104 @@ +--- +name: Build zstandard wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'zstandard version to build (git tag, e.g. 0.25.0)' + required: true + default: '0.25.0' + pull_request: + paths: + - '.github/workflows/build-zstandard.yml' + - 'actions/publish-to-gitlab/**' + +concurrency: + group: ${{ github.workflow }}-${{ inputs.version || '0.25.0' }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + # `inputs.version` is empty on pull_request events; default to 0.25.0 there. + ZSTANDARD_VERSION: ${{ inputs.version || '0.25.0' }} + UV_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ + UV_INDEX_STRATEGY: unsafe-best-match + UV_ONLY_BINARY: ':all:' + +jobs: + build_wheels: + name: Build zstandard ${{ inputs.version || '0.25.0' }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + python: ["cp312", "cp313", "cp314", "cp314t"] + + steps: + - name: Checkout python-wheels + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + path: python-wheels-repo + persist-credentials: false + + # zstandard vendors the zstd C library as a submodule and, unlike numpy, + # tags releases without a leading `v` (e.g. `0.25.0`), so the ref is the + # bare version. + - name: Checkout zstandard ${{ env.ZSTANDARD_VERSION }} + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: indygreg/python-zstandard + ref: ${{ env.ZSTANDARD_VERSION }} + submodules: recursive + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 + env: + CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 + # Upstream pins `build-frontend = "build[uv]"` in pyproject.toml, which + # fails on riscv64: uv is not present in the manylinux_riscv64 image, so + # cibuildwheel aborts on `which uv`. Force the plain build frontend. + CIBW_BUILD_FRONTEND: build + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: zstandard-${{ env.ZSTANDARD_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: ./wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish zstandard ${{ inputs.version || '0.25.0' }} to GitLab + needs: build_wheels + # Only publish when the workflow was triggered from main with a specific + # version. Manual trigger is the only entry point, so checking the ref is + # enough to gate uploads. + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-24.04-riscv + permissions: + contents: read + + steps: + - name: Checkout python-wheels + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + path: python-wheels-repo + persist-credentials: false + + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + pattern: zstandard-${{ env.ZSTANDARD_VERSION }}-*-manylinux_riscv64 + path: dist + merge-multiple: true + + - name: Publish to GitLab PyPI registry + uses: ./python-wheels-repo/actions/publish-to-gitlab + with: + gitlab-username: ${{ vars.GITLAB_DEPLOY_USER }} + gitlab-token: ${{ secrets.GITLAB_DEPLOY_TOKEN }} + gitlab-project-id: ${{ vars.GITLAB_PROJECT_ID }} + files: | + dist/*.whl diff --git a/ci_scripts/packages.txt b/ci_scripts/packages.txt index fecac92..c8d8dd4 100644 --- a/ci_scripts/packages.txt +++ b/ci_scripts/packages.txt @@ -50,3 +50,4 @@ ujson uvloop websockets z3-solver +zstandard From 5594c3e22c11958cd13462455d4a98b876914c23 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Tue, 14 Jul 2026 18:17:32 +0200 Subject: [PATCH 2/3] zstandard: fix cibuildwheel 4.x enable groups, test build[uv] The 0.25.0 tag pins enable = ["cpython-freethreading", "cpython-prerelease"] and targets cibuildwheel 3.x. RISE pins cibuildwheel 4.1.0, which removed the cpython-freethreading group (freethreaded builds are default now) and errors on it at config-parse. Strip that group so 4.1.0 can read the config. Also drop the CIBW_BUILD_FRONTEND override: the manylinux_2_39_riscv64 image now ships uv, so let upstream's build[uv] frontend run and confirm it works on riscv64 rather than forcing the plain build frontend. Signed-off-by: Bruno Verachten --- .github/workflows/build-zstandard.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-zstandard.yml b/.github/workflows/build-zstandard.yml index 59bd2cc..78d0a0b 100644 --- a/.github/workflows/build-zstandard.yml +++ b/.github/workflows/build-zstandard.yml @@ -54,14 +54,29 @@ jobs: submodules: recursive persist-credentials: false + # zstandard 0.25.0 targets cibuildwheel 3.x and pins + # `enable = ["cpython-freethreading", "cpython-prerelease"]`. cibuildwheel + # 4.x dropped the cpython-freethreading group (freethreaded builds are on + # by default now) and errors out on it at config-parse. Strip it so the + # pinned 4.1.0 can read the config; freethreaded cp314t still builds. + # Upstream HEAD already removed it, so this is only needed for this tag. + - name: Make pyproject enable groups compatible with cibuildwheel 4.x + working-directory: ${{ github.workspace }} + run: | + python3 - <<'PY' + import pathlib + p = pathlib.Path("pyproject.toml") + t = p.read_text() + for tok in ('"cpython-freethreading", ', ', "cpython-freethreading"', + '"cpython-freethreading"'): + t = t.replace(tok, "") + p.write_text(t) + PY + - name: Build wheels uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 env: CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 - # Upstream pins `build-frontend = "build[uv]"` in pyproject.toml, which - # fails on riscv64: uv is not present in the manylinux_riscv64 image, so - # cibuildwheel aborts on `which uv`. Force the plain build frontend. - CIBW_BUILD_FRONTEND: build - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: From cb6c78d1eb20b993860be47b69d1920725e60c5d Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 15 Jul 2026 08:34:55 +0200 Subject: [PATCH 3/3] =?UTF-8?q?zstandard:=20address=20review=20=E2=80=94?= =?UTF-8?q?=20drop=20unused=20checkouts,=20ubuntu-latest=20publish,=20cp31?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove the leftover Checkout python-wheels step in build_wheels (unused). - Publish job runs on ubuntu-latest (no need for a riscv64 runner). - Use riseproject-dev/python-wheels/actions/publish-to-gitlab@main and drop the publish job's checkout. - Add cp311 to the build matrix per the updated dev-guide matrix. Signed-off-by: Bruno Verachten --- .github/workflows/build-zstandard.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-zstandard.yml b/.github/workflows/build-zstandard.yml index 78d0a0b..3ad34af 100644 --- a/.github/workflows/build-zstandard.yml +++ b/.github/workflows/build-zstandard.yml @@ -34,15 +34,9 @@ jobs: strategy: fail-fast: false matrix: - python: ["cp312", "cp313", "cp314", "cp314t"] + python: ["cp311", "cp312", "cp313", "cp314", "cp314t"] steps: - - name: Checkout python-wheels - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - path: python-wheels-repo - persist-credentials: false - # zstandard vendors the zstd C library as a submodule and, unlike numpy, # tags releases without a leading `v` (e.g. `0.25.0`), so the ref is the # bare version. @@ -91,17 +85,11 @@ jobs: # version. Manual trigger is the only entry point, so checking the ref is # enough to gate uploads. if: github.ref == 'refs/heads/main' - runs-on: ubuntu-24.04-riscv + runs-on: ubuntu-latest permissions: contents: read steps: - - name: Checkout python-wheels - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - path: python-wheels-repo - persist-credentials: false - - name: Download wheels uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: @@ -110,7 +98,7 @@ jobs: merge-multiple: true - name: Publish to GitLab PyPI registry - uses: ./python-wheels-repo/actions/publish-to-gitlab + uses: riseproject-dev/python-wheels/actions/publish-to-gitlab@main with: gitlab-username: ${{ vars.GITLAB_DEPLOY_USER }} gitlab-token: ${{ secrets.GITLAB_DEPLOY_TOKEN }}