Skip to content

docs: Update projects #74

docs: Update projects

docs: Update projects #74

Workflow file for this run

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on the `build_wheels` job of
# https://github.com/MikePopoloski/slang/blob/v12.0/.github/workflows/python-dist.yml
name: Build pyslang wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/pyslang.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-pyslang.yml'
- 'docs/packages/pyslang.yaml'
push:
branches: [main]
paths:
- '.github/workflows/build-pyslang.yml'
- 'docs/packages/pyslang.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
# external/CMakeLists.txt FetchContent-pulls fmt and bindings/CMakeLists.txt
# pybind11; bump these alongside those pins.
FMT_TAG: '12.1.0'
PYBIND11_TAG: v3.0.4
BS_THREAD_POOL_TAG: v5.1.0
jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
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 }} cp311-abi3-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
env:
PYSLANG_VERSION: ${{ matrix.version }}
steps:
# Upstream tags two components (v11.0) but the wheel says 11.0.0.
- id: tag
run: echo "ref=v${PYSLANG_VERSION%.0}" >> "$GITHUB_OUTPUT"
- name: Checkout slang ${{ steps.tag.outputs.ref }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: MikePopoloski/slang
ref: ${{ steps.tag.outputs.ref }}
# cmake/gitversion.cmake reads `git describe --tags` for the patch segment.
fetch-depth: 0
persist-credentials: false
# fmt (MIT) and pybind11 (BSD-3-Clause) are fetched from source and compiled
# in, as are the vendored BS_thread_pool.hpp (MIT) and the Boost/expected-lite
# headers (BSL-1.0); upstream's `wheel.license-files = ["LICENSE"]` ships none
# of them, so stage each notice and widen the list.
- name: Stage the vendored dependencies' licences
run: |
set -euo pipefail
curl -fsSL --retry 5 "https://raw.githubusercontent.com/fmtlib/fmt/${FMT_TAG}/LICENSE" -o LICENSE.fmt
curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/${PYBIND11_TAG}/LICENSE" -o LICENSE.pybind11
curl -fsSL --retry 5 "https://raw.githubusercontent.com/bshoshany/thread-pool/${BS_THREAD_POOL_TAG}/LICENSE.txt" -o LICENSE.bs-thread-pool
cp LICENSES/BSL-1.0.txt LICENSE.boost-headers
- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
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"'
- name: Check wheel contents
run: |
python3 - wheelhouse/*.whl <<'EOF'
import sys, zipfile
names = zipfile.ZipFile(sys.argv[1]).namelist()
exts = [n for n in names if n.endswith(".so")]
# nanobind's split mode (stable ABI) names the extension
# "<module>.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("/")}
assert licences == {"LICENSE", "LICENSE.boost-headers", "LICENSE.bs-thread-pool",
"LICENSE.fmt", "LICENSE.pybind11"}, licences
EOF
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pyslang-${{ env.PYSLANG_VERSION }}-cp311-abi3-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish pyslang ${{ 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: pyslang-${{ matrix.version }}-*-manylinux_riscv64