Skip to content

brotli: add build-brotli.yml for riscv64 wheels - #361

Merged
luhenry merged 1 commit into
mainfrom
brotli
Aug 25, 2026
Merged

brotli: add build-brotli.yml for riscv64 wheels#361
luhenry merged 1 commit into
mainfrom
brotli

Conversation

@luhenry

@luhenry luhenry commented Aug 25, 2026

Copy link
Copy Markdown
Member

Adds a riscv64 wheel build for brotli 1.2.0
(the Python bindings in google/brotli).

Upstream publishes per-interpreter compiled wheels (cpXY-cpXY) for x86_64,
aarch64 and ppc64le, glibc and musl — but nothing for riscv64.

Shape

Plain build-from-checkout with cibuildwheel. setup.py compiles
python/_brotli.c against brotli's own vendored C tree (c/common, c/dec,
c/enc), so no external native dependency and no before-build are needed —
CIBW_MANYLINUX_RISCV64_IMAGE is the only build-side override.

Matrix is per-interpreter (cp312/cp313/cp314/cp314t): the extension is
not abi3, matching the cpXY-cpXY wheels upstream ships.

Testing

Upstream's CI runs python setup.py test, which discovers python/**/*_test.py.
The test command is gone from modern setuptools, so the workflow runs the
equivalent python -m unittest discover -s python -p '*_test.py'.

The suite resolves its fixtures relative to the source tree (tests/testdata,
and python/bro.py which bro_test.py spawns as a subprocess), so those are
staged with CIBW_TEST_SOURCES alongside python/tests. Because cibuildwheel
runs the tests from an otherwise-empty directory, import brotli /
import _brotli resolve to the installed wheel rather than the checkout.

Verified locally on aarch64 before pushing: 595 tests pass, the wheel contains
_brotli.cpython-3XX-*.so, brotli.__file__ and _brotli.__file__ both point
into site-packages, and the wheel carries upstream's MIT LICENSE (all C
sources are brotli's own, so there is no third-party licence to add).

google/brotli publishes per-interpreter compiled wheels for every other
Linux arch but none for riscv64. The extension vendors brotli's own C
sources, so a plain build-from-checkout cibuildwheel run suffices.

Tests mirror upstream's `setup.py test` (removed from modern setuptools)
via `unittest discover -s python`; python/tests, python/bro.py and
tests/testdata are staged with test-sources so the suite's relative
lookups resolve.
@luhenry
luhenry merged commit f4973c0 into main Aug 25, 2026
8 checks passed
@luhenry
luhenry deleted the brotli branch August 25, 2026 16:02
@luhenry luhenry linked an issue Aug 25, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

brotli riscv64 support

1 participant