diff --git a/.github/workflows/build-pyslang.yml b/.github/workflows/build-pyslang.yml index fe4291bb7d3a..c09785d0cfb0 100644 --- a/.github/workflows/build-pyslang.yml +++ b/.github/workflows/build-pyslang.yml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MIT --- # This workflow is based on the `build_wheels` job of -# https://github.com/MikePopoloski/slang/blob/v11.0/.github/workflows/python-dist.yml +# https://github.com/MikePopoloski/slang/blob/v12.0/.github/workflows/python-dist.yml name: Build pyslang wheels (riscv64) on: @@ -45,17 +45,30 @@ jobs: package: pyslang version: ${{ inputs.version }} + # v12.0.0 moved bindings/CMakeLists.txt from pybind11 to nanobind's split mode + # (nanobind_add_module(... BACKEND_MODULE nanobind_backend STABLE_ABI_VERSION + # 3.11)): pyproject.toml now sets `wheel.py-api = "cp311"`, so cibuildwheel + # produces a single cp311-abi3 wheel that covers every newer non-free-threaded + # interpreter (CLAUDE.md gotcha 11), and upstream's own python-dist.yml builds + # it once per OS with no interpreter matrix at all. Building it on cp312+ + # here (as the old per-interpreter pybind11 matrix did) would tag the wheel + # cp311-abi3 while compiling it against newer headers than the tag claims + # (gotcha 96), so build on cp311, the floor the tag actually promises. + # + # Free-threaded (cp314t) is dropped: nanobind-backend>=1.0 publishes no + # cp313t/cp314t wheel on *any* platform (only cp315t), so pyslang ships no + # free-threaded wheel upstream either (the litellm/gotcha-11 "abi3-only, no + # cp314t variant" shape) -- this is an upstream gap, not riscv64-specific. build_wheels: needs: [setup] if: needs.setup.outputs.versions != '[]' - name: Build pyslang ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + name: Build pyslang ${{ matrix.version }} cp311-abi3-manylinux_riscv64 runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - python: ["cp312", "cp313", "cp314", "cp314t"] env: PYSLANG_VERSION: ${{ matrix.version }} @@ -90,7 +103,7 @@ jobs: uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 with: output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 + only: cp311-manylinux_riscv64 env: CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} CIBW_ENVIRONMENT: 'SKBUILD_WHEEL_LICENSE_FILES="LICENSE;LICENSE.boost-headers;LICENSE.bs-thread-pool;LICENSE.fmt;LICENSE.pybind11"' @@ -101,8 +114,10 @@ jobs: import sys, zipfile names = zipfile.ZipFile(sys.argv[1]).namelist() exts = [n for n in names if n.endswith(".so")] - assert len(exts) == 1 and exts[0].startswith("pyslang/pyslang.cpython-"), exts - assert exts[0].endswith("-riscv64-linux-gnu.so"), exts + # nanobind's split mode (stable ABI) names the extension + # ".abi3.so" with no interpreter/platform tag baked in -- that + # information already lives in the wheel's own filename instead. + assert exts == ["pyslang/pyslang.abi3.so"], exts assert any(n.endswith(".pyi") for n in names), names licences = {n.split(".dist-info/licenses/", 1)[1] for n in names if ".dist-info/licenses/" in n and not n.endswith("/")} @@ -112,7 +127,7 @@ jobs: - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: pyslang-${{ env.PYSLANG_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + name: pyslang-${{ env.PYSLANG_VERSION }}-cp311-abi3-manylinux_riscv64 path: wheelhouse/*.whl if-no-files-found: error diff --git a/docs/packages/pyslang.yaml b/docs/packages/pyslang.yaml index 6eaa773b1e07..e0e5816e6353 100644 --- a/docs/packages/pyslang.yaml +++ b/docs/packages/pyslang.yaml @@ -13,3 +13,4 @@ versions: sha256: 4a7afec71fefc257b7e5c8ef21afd4cafab307e996cab86028f78f8b9676764f - filename: pyslang-11.0.0-cp314-cp314t-manylinux_2_39_riscv64.whl sha256: 594be7f4426650552dd3e58803d2b5bd7c0582c6a90bdee1899270edc0e722b7 +- version: 12.0.0