google-crc32c: add build-google-crc32c.yml for riscv64 wheels - #313
Merged
Conversation
Builds riscv64 wheels for google-crc32c 1.8.0. The C extension links the external google/crc32c C library (vendored as the google_crc32c/ submodule), built once via CMake in CIBW_BEFORE_ALL and vendored into each wheel by auditwheel. CRC32C_PURE_PYTHON=0 forces the C build so a compile/link failure hard-fails instead of silently shipping a pure-Python wheel. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The crc32c CMake pulls in third_party/glog via add_subdirectory when CRC32C_USE_GLOG is on (the default), but glog is a nested submodule and actions/checkout submodules:true is not recursive, so its directory is empty and configure fails. glog is only used by crc32c's own tests/benchmarks (both disabled here), so -DCRC32C_USE_GLOG=no drops it — leaner build, no recursive submodule fetch needed. Verified under QEMU riscv64 on a non-recursive checkout: 42 tests pass, wheel ships _crc32c.so + vendored libcrc32c.so. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
threexc
approved these changes
Aug 24, 2026
threexc
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. We'll have to note that we disable the glog stuff for testing.
…glog The crc32c C library has nested submodules (glog etc.) that its CMake pulls in via add_subdirectory. Rather than disabling the feature (-DCRC32C_USE_GLOG=no) to dodge the fetch under a non-recursive submodules:true checkout, use submodules: recursive — the upstream-faithful path (upstream builds with git submodule update --init --recursive) and self-documenting. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Adds a riscv64 wheel build for google-crc32c 1.8.0, published to
pypi.riseproject.dev. PyPI ships no riscv64 wheel for this package.What it builds
google-crc32cis a thin C extension (google_crc32c._crc32c) wrapping Google's externalcrc32cC library. That library is not bundled in the sdist — upstream vendors it as thegoogle_crc32c/git submodule (github.com/google/crc32c). The workflow follows upstream'sscripts/manylinux/build_on_centos.sh:submodules: true, thenpypa/cibuildwheeldirectly.CIBW_BEFORE_ALLbuildslibcrc32conce via CMake (shared lib, into the container's default prefix); auditwheel then vendorslibcrc32c.sointo each wheel.CRC32C_PURE_PYTHON=0forces the C extension. Upstream'ssetup.pysilently falls back to a pure-Python build on any compile/link failure (gotcha 20) — this flag makes it hard-fail instead, so a broken build can't ship a mislabeled pure-Python wheel.[cp312, cp313, cp314, cp314t]— plain per-interpreter C extension (PyPI showscp3x-cp3x, no abi3).implementation == 'c'assertion.Local validation (QEMU riscv64 on aarch64)
_crc32c.cpython-312-riscv64-linux-gnu.so+ vendoredlibcrc32c-*.so.1.1.0(confirmed a real C-ext wheel, not the pure-Python fallback).implementation = c,value(b'123456789') = 0xe3069283(canonical CRC32C check value), 42 tests passed.🤖 Generated with Claude Code