This example builds the zstandard project cross-python-version, cross-os, and cross-machine using the following tools:
- Bazel
- python-build-standalone (via rules_python)
- A derivative of crossenv (via rules_pycross)
- repairwheel (via rules_pycross)
- zig cc (via hermetic_cc_toolchain)
To use:
- First, install bazelisk
- Run tests:
./run_tests.sh cp39
(orcp310
,cp311
,cp312
) - Build a wheel:
./build_wheel.sh cp39 linux-aarch64
(see usage for other platforms)
Built extensions are dynamically linked to an in-built libzstd
which is vendored in the built wheel after running through repairwheel
.
Wheel builds are (or at least should be) fully reproducible - even
when built on different build host platforms. I.e., the macos-aarch64
wheel should have the same sha256 hash whether it was built on macOS or on linux.
Big caveat: this only supports linux and macOS, not Windows.