amazon-ion: add build-amazon-ion.yml for riscv64 wheels - #524
Merged
Conversation
Mirrors the `build-wheels` job of upstream's release.yml, narrowed to riscv64: a build-from-checkout cibuildwheel run over cp312/cp313/cp314/ cp314t, with upstream's own `py.test --ignore tests/test_benchmark_*` command as the wheel test. The extension statically links ion-c and IBM's decNumber but the wheel carries only ion-python's LICENSE, so carry a patch adding the missing NOTICE and vendored licence files, and assert from the test command that they land in the wheel.
The cp314t job failed to configure with `Could NOT find Python3 (missing: Development.Module)`: py-build-cmake only passes the `t` flag in `Python3_FIND_ABI` when `cmake.minimum_version` is at least 3.30, and the project leaves that key at its 3.15 default. Reproduced and fixed against quay.io/pypa/manylinux_2_39_aarch64, where a cp314t build fails identically without the patch and succeeds with it; a cp312 build is unaffected either way.
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
.github/workflows/build-amazon-ion.yml, building riscv64 wheels for amazon-ion 0.14.6 (amazon-ion/ion-python). PyPI ships manylinux/musllinux wheels for x86_64, i686 and aarch64 but nothing for riscv64, sopip install amazon-ionon riscv64 falls back to compiling ion-c from the sdist.Shape
Build-from-checkout, mirroring the
build-wheelsjob of upstream's release.yml narrowed to riscv64. The project builds throughpy-build-cmake, which drives CMake oversrc/ioncmodule.cplus the whole of thesrc/ion-csubmodule (ion-c + IBM decNumber, statically linked intoamazon/_ioncmodule.so).cmakeandninjaboth publish riscv64 wheels on PyPI, so the isolated build env provisions its own toolchain and nodnfstep is needed.Matrix is per-interpreter
cp312/cp313/cp314/cp314t— the extension is a plain (non-abi3) CPython module, so each interpreter needs its own wheel. Upstream builds cp39–cp313; cp314 and cp314t compile and pass the full suite unchanged (verified locally on macOS/arm64 before pushing).Upstream's
Fetch ion-c tagsstep is carried as-is: ion-c derives its version macros fromgit describe --match "v*", and a submodule checkout fetches no tags.Testing
CIBW_TEST_COMMANDruns upstream's own invocation,py.test --ignore tests/test_benchmark_cli.py --ignore tests/test_benchmark_spec.py(the benchmark tests need thebenchmarkingextra, which upstream also skips in CI), withCIBW_TEST_EXTRAS: testso pytest comes from the project's own pin.CIBW_TEST_SOURCES: tests vectors pyproject.tomlstages the ion-tests vectors submodule at its original relative path, becausetests/test_vectors.pyresolves its data as<rootdir>/vectors/iontestdata.PIP_EXTRA_INDEX_URLpoints at our registry sojsonconversion's numpy dependency resolves to the riscv64 wheel we already publish.Two assertions run ahead of the suite, because it would otherwise pass without the extension:
from amazon.ion.simpleion import c_ext; assert c_ext(the suite branches onc_extand silently exercises only the pure-Python reader when the.sois missing), and a check that the patched licence files are present in the installed metadata. A post-build step also asserts the.sois in the wheel. Locally, 29163 tests pass on cp314t against the built wheel.Patches
patches/amazon-ion/0.14.6/0001-Package-the-NOTICE-and-vendored-ion-c-decNumber-lice.patch— the wheel statically links ion-c (Apache-2.0, with its ownNOTICE) and decNumber (ICU licence) but ships only ion-python'sLICENSE; ion-python's ownNOTICEis missing too. Apache-2.0 §4(d) requires the NOTICE of the redistributed work to travel with the binary, and the ICU licence requires its copyright notice to accompany binary redistributions. The patch declareslicense = "Apache-2.0"plus a PEP 639license-fileslist;py-build-cmakecopies those into.dist-info/licenses/but rejects the key unlesslicenseis an SPDX expression, hence both halves. The gap affects every amazon-ion wheel on PyPI, not just riscv64, so it is taggedTo upstreampending a maintainer discussion rather than a drive-by PR.patches/amazon-ion/0.14.6/0002-Require-CMake-3.30-so-free-threaded-builds-configure.patch— sets[tool.py-build-cmake.cmake] minimum_version = "3.30". py-build-cmake only adds thetflag toPython3_FIND_ABIwhen that key allows it to assume CMake 3.30 (the first release whose FindPython understands the free-threaded ABI); left at its 3.15 default, the cp314t job loggedCMake version 3.15 does not support the free-threaded ABIand then died onCould NOT find Python3 (missing: Development.Module). The key gates nothing else, so the GIL-ful builds are byte-for-byte unaffected — they already resolve to an all-OFF ABI tuple that is never passed to CMake. Arch-independent: it reproduces and fixes identically inquay.io/pypa/manylinux_2_39_aarch64.CI
All four matrix jobs green on
ubuntu-24.04-riscv, 29163 tests passed per interpreter, and the publish job dry-ran listing the four wheels (amazon_ion-0.14.6-{cp312-cp312,cp313-cp313,cp314-cp314,cp314-cp314t}-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl).