Skip to content

fastavro: add build-fastavro.yml for riscv64 wheels - #424

Merged
luhenry merged 1 commit into
mainfrom
fastavro
Aug 26, 2026
Merged

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

Conversation

@luhenry

@luhenry luhenry commented Aug 26, 2026

Copy link
Copy Markdown
Member

Adds .github/workflows/build-fastavro.yml, building fastavro 1.12.2 riscv64 wheels for cp312/cp313/cp314/cp314t.

fastavro publishes per-interpreter Cython-compiled manylinux/musllinux wheels for every architecture except riscv64. The workflow mirrors the build-wheels job of upstream's build_linux.yml, narrowed to manylinux_riscv64: check out the tag, hand it to cibuildwheel, which cythonizes in-container from the Cython in build-system.requires. Upstream's host-side make all exists only to keep cython off their QEMU emulation and is a no-op for wheel content, so it is dropped.

Testing

Upstream's CI tests the checkout (run-tests.sh: build_ext --inplace + pip install -e .) and never tests the built wheel, so the test step reproduces their pytest invocation against the installed wheel instead:

  • CIBW_TEST_SOURCES: tests pytest.ini stages only the suite, so the repo-root fastavro/ cannot shadow the installed extension modules (tests/ is a package with relative imports, so pytest's rootdir insertion would otherwise win).
  • Upstream's own is_testing_cython_modules() is chained ahead of pytest as the proof that the compiled modules — not the pure-Python fallback — are what got imported, alongside a step asserting all six .so are in the wheel.

697 passed, 11 skipped in a local dry run of the exact test command against a locally built wheel (macOS/arm64, Cython 3.3.0 — which compiles fastavro 1.12.2 cleanly, so no version ceiling is needed).

Two deviations

cramjam is built from source in-container. It has no riscv64 wheel anywhere, so Rust is installed via CIBW_BEFORE_ALL_LINUX and pip builds its maturin sdist (31s on an arm64 host). It is not optional: tests/test_fastavro.py raises pytest.skip from the generator feeding test_file's parametrize when snappy is unavailable, which aborts collection of that entire module — 152 of the suite's 709 tests, including most of the core reader/writer coverage.

test_regular_vs_ordered_dict_record_typeerror is deselected. It asserts on the source line of a traceback frame; Cython embeds the relative path fastavro/_write.pyx, so the assertion only holds when the cwd is a checkout carrying a build_ext --inplace build. Against any installed wheel it reads back an empty line. Reproduced on macOS/arm64 — an upstream in-place-build assumption, not a riscv64 defect.

Test dependencies

numpy, pandas and lz4 come from pypi.riseproject.dev via PIP_EXTRA_INDEX_URL; backports.zstd has riscv64 wheels on PyPI (and is only needed below 3.14, which has compression.zstd in the stdlib); zlib_ng builds from sdist with the image's configure/make.

The registry hosts no free-threaded pandas, so the cp314t matrix entry drops it and deselects the one test that imports it. The GIL-ful entries pin pandas<3.0.4, the newest build we host — without the ceiling pip resolves PyPI's 3.0.5 across both indexes and tries to compile it from sdist.

Licensing

The wheel carries LICENSE and NOTICE.txt in dist-info/licenses/; nothing third-party is vendored or linked beyond the Cython-generated C.

fastavro publishes per-interpreter Cython-compiled manylinux/musllinux
wheels for every architecture but riscv64. Mirror the `build-wheels` job
of upstream's build_linux.yml, narrowed to manylinux_riscv64: check out
the tag and hand it to cibuildwheel, which cythonizes in-container via
the Cython in build-system.requires (upstream's host-side `make all` only
exists to keep cython off their QEMU emulation).

Testing follows upstream's run-tests.sh pytest invocation rather than
their CI, which tests the checkout and never tests the built wheel:
CIBW_TEST_SOURCES stages only tests/ and pytest.ini so the repo-root
fastavro/ cannot shadow the installed extension modules, and upstream's
own is_testing_cython_modules() asserts the compiled modules are what got
imported. 697 tests pass, 11 skip.

Two deviations, both justified in the file:

- cramjam has no riscv64 wheel anywhere, so Rust is installed in the
  container and it builds from its maturin sdist (31s on an arm64 host).
  It is not optional: tests/test_fastavro.py raises pytest.skip from the
  generator feeding test_file's parametrize when snappy is unavailable,
  which aborts collection of that whole module - 152 of the suite's 709
  tests, including most of the core reader/writer coverage.

- test_regular_vs_ordered_dict_record_typeerror asserts on the source
  line of a traceback frame. Cython embeds the relative path
  fastavro/_write.pyx, so the assertion only holds when the cwd is a
  checkout with a build_ext --inplace; against any installed wheel it
  reads back an empty line. Reproduced on macOS/arm64, so it is an
  upstream in-place-build assumption, not a riscv64 defect.

pandas has no free-threaded riscv64 wheel on our registry, so the cp314t
entry drops it and deselects the single test that imports it; the
GIL-ful entries pin below 3.0.4, the newest build we host (pip would
otherwise pick PyPI's 3.0.5 and try to compile it from sdist).
@luhenry
luhenry merged commit cbdb29c into main Aug 26, 2026
8 checks passed
@luhenry
luhenry deleted the fastavro branch August 26, 2026 15:42
@luhenry luhenry linked an issue Aug 26, 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.

fastavro riscv64 support

1 participant