onnxruntime: add build-onnxruntime.yml for riscv64 wheels - #363
Merged
Conversation
onnxruntime publishes no sdist and its setup.py packages an already-built CMake tree, so cibuildwheel can't drive it: the workflow mirrors upstream's py-linux.yml by running tools/ci_build/build.py inside the manylinux riscv64 image, then repairs and tests the wheel the same way run_python_tests.sh does.
Upstream's build image adds a non-root onnxruntimedev user and runs the build as it; the manylinux container runs as root, which build.py refuses by default.
…tall run_python_tests.sh installs /build/<config>/requirements.txt (cmake's copy of the repo-root one) before the --no-index install, so onnxruntime's runtime dependencies resolve from an index; without it the test container only had whatever the CI test requirements happened to pull in.
The smoke check asserted on onnxruntime.capi._pybind_state, which is a pure-Python shim that re-exports the extension; the compiled module is onnxruntime.capi.onnxruntime_pybind11_state. All four jobs built and auditwheel-repaired their wheel and then failed on that assertion. The cp312 job separately lost a ~9h runner slot to a transient "No URLs in mirrorlist" from dnf, so that install is now retried.
This was referenced Aug 27, 2026
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 onnxruntime 1.29.0.
onnxruntime publishes no sdist, and its
setup.pypackages an already-built CMake tree rather than driving the build itself, so cibuildwheel cannot be used. The workflow mirrors upstream'stemplates/py-linux.ymland the two scripts it runs inside the build container (build_linux_python_package.sh,run_python_tests.sh): apodman runagainstquay.io/pypa/manylinux_2_39_riscv64invokestools/ci_build/build.py, then the wheel is auditwheel-repaired and tested.Deviations from upstream, all noted inline:
--use_vcpkg/--use_vcpkg_ms_internal_asset_cachedropped - the asset cache is MS-internal and the dependencies build fine fromcmake/deps.txt;--enable_ltodropped, to keep peak link memory and build time down on the riscv runner;--compile_no_warning_as_errorpassed explicitly - upstream gets the same effect fromSYSTEM_COLLECTIONURIbeing set in ADO (seebuild.py:use_dev_mode);auditwheel repairrun explicitly -setup.py's manylinux allow-list has no riscv64 entry, so it tags the wheellinux_riscv64and skips the repair it runs elsewhere;run_python_tests.shalso runs are skipped: they test the library rather than the wheel and read the ONNX node corpus from/data/onnx, which upstream mounts from its own agents.The Python test list is
build.py:run_onnxruntime_tests' own CPU path, unchanged.