protobuf-py-ext: add build-protobuf-py-ext.yml for riscv64 wheels - #1872
Merged
Merged
Conversation
Ports bufbuild/protobuf-py's native extension (a standalone pyo3/maturin crate at packages/protobuf-py-ext in that monorepo, no C/C++ dependencies and no relation to the classic protocolbuffers/protobuf package already built in this repo) to riscv64. Mirrors upstream's release.yaml ext-linux job: one abi3 wheel built with --features pyo3/abi3-py310 for cp310/cp311, plus separate per-interpreter wheels for cp312/cp313/cp314/cp314t. musllinux is dropped (no riscv64 musl host toolchain from rustup.rs). The wheel ships no LICENSE (maturin only globs it beside pyproject.toml, which in this monorepo is the packages/protobuf-py-ext subdirectory), so the workflow copies it there before building. Tests exercise the extension's descriptor-free public surface directly (Oneof, generic_setattr, NativeMessage's bare construction) plus the one upstream test that needs neither buf nor protoc (test_ext_marshaler.py's protobuf._native_message.NativeMessageClass detection), since the rest of upstream's suite depends on protoc/buf codegen with no riscv64 wheel.
luhenry
added a commit
that referenced
this pull request
Sep 13, 2026
The checkout's own root pyproject.toml sets [tool.pytest] addopts to --benchmark-disable/--benchmark-group-by=func,param:_id, which pytest 9.1.1 picks up as the inifile by directory proximity even for an explicit file target, and pytest-benchmark isn't in CIBW_TEST_REQUIRES. All 5 riscv64 legs failed on exactly this before the wheel build itself was ever exercised. -c points pytest at a fresh empty ini instead.
A plain __dict__-based class accepts any new attribute name via PyObject_GenericSetAttr, so asserting AttributeError on a never-set 'missing' attribute never raised; every riscv64 leg hung right after that failing assertion until the default 360-minute job timeout killed it. Use a __slots__ class instead, which genuinely rejects an unknown attribute name the way generic_setattr's real callers rely on. Also caps the job at 60 minutes so a future hang fails fast instead of holding a runner for six hours.
Reproduced twice on riscv64: constructing a bare NativeMessage() (no marshaler wired) hangs every leg until the job timeout, regardless of whether the prior test in the file passed or failed. Real usage always wires a marshaler via initialize_message_type before construction (via protobuf-py's protoc-generated subclasses), so this exercises an essentially untested bootstrap path. Check the class's shape instead of instantiating it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
protobuf-py-ext0.3.0Compiles Buf's pyo3/maturin native marshaling extension for protobuf-py, a standalone Rust crate with no C/C++ dependencies (unrelated to the classic protocolbuffers/protobuf already built in this repo). Upstream publishes no riscv64 wheel.
Mirrors upstream's
release.yamlext-linuxjob.Differs from upstream
LICENSEintopackages/protobuf-py-ext/before building - maturin's default glob misses it there.Matrix:
cp310-abi3(covers cp310/cp311) pluscp312/cp313/cp314/cp314t, matching upstream's five published wheels.Testing
Oneof,generic_setattr,NativeMessage) plus upstream's own protoc-freetest_ext_marshaler.pyassertion.License: OK
cargo build --release/cargo check --target riscv64gc-unknown-linux-gnuclean locally (aarch64); riscv64 wheel build + 6-test pytest suite pending first CI run.