Add working ONNX 1.15 recipe#620
Conversation
|
Thanks, but onnx is already building pyodide wheels in their repository and publishing to pypi so this is not needed. |
|
Yes, agreed. Also, they only build for the 2025 ABI and not the 2026 ABI based on https://pypi.org/project/onnx/#files, so perhaps you please request them to do so, @metalmancode? Thanks! |
|
Thank you for pointing me to the correct upstream location. I moved the 2026 ABI follow-up to ONNX and opened: The change now successfully builds Thanks again for the guidance. — Gholamreza Rashidi Ardestani |
## Summary - target the Python 3.14 Pyodide cross-build environment - produce a `pyemscripten_2026_0_wasm32` wheel instead of the current 2025 ABI wheel - allow the Emscripten deprecated-macro pragmas emitted by protobuf's bundled Abseil while retaining `ONNX_WERROR=ON` for other warnings The additional warning exception is needed because the newer Emscripten headers deprecate `__EMSCRIPTEN_major__`, `__EMSCRIPTEN_minor__`, and `__EMSCRIPTEN_tiny__`, which the bundled Abseil headers still reference. ## Validation The repository's official `Pyodide Build` workflow was run on this branch: https://github.com/metalmancode/onnx-pyodide-abi/actions/runs/29329430629 It completed successfully, including the cibuildwheel runtime test in a Python 3.14 Pyodide virtual environment. The produced artifact is: ```text onnx_weekly-1.23.0.dev20260714-cp312-abi3-pyemscripten_2026_0_wasm32.whl SHA-256: ab20c140cbe5dfa63068ae476fcf9eb5b76d9fc4ce94b8fb2badbd391364bc37 ``` `lintrunner` also completed with no lint issues. ## Context This follows the Pyodide maintainers' recommendation in pyodide/pyodide-recipes#620 to publish the 2026 ABI wheel from the ONNX repository rather than add a separate recipe. The current stable and weekly ONNX Pyodide wheels are published with the 2025 ABI. A stable browser distribution for the Python 3.14 Pyodide environment is not yet available, so the validation uses cibuildwheel's official Python 3.14 Pyodide runtime test. --------- Signed-off-by: Gholamreza Rashidi Ardestani <rrashidi@gmail.com>
Summary
Add an experimental ONNX 1.15.0 recipe with a reproducible, working WebAssembly build.
Closes #216 with a version set that has been built from the recipe, structurally verified, and exercised through a full browser conversion path.
Cross-compilation fixes
protoc22.3 while compiling the Protobuf runtime for WebAssembly;PYTHONINCLUDEto CMake;--exclude-libslinker option unsupported bywasm-ld; andThe host
protocarchive is pinned by SHA-256.Validation
The independently reproduced Pyodide 0.29.4 / Python 3.13 build produced a 1.7 MB wheel and passed:
import onnx,onnx.checker, andonnx.helper;scikit-learntraining;skl2onnx1.19.1;Public recipe and build provenance:
https://github.com/metalmancode/onnx-pyodide
Live end-to-end proof:
https://metalmancode.github.io/onnx-pyodide/demo/
Verified release and wheel:
https://github.com/metalmancode/onnx-pyodide/releases/tag/v0.1.0
Wheel SHA-256:
2a827f6e2649395743afac49186343ca9221f48a1c67cce300cd019a7f448cd4Current-repository validation
The recipe now builds successfully with the repository's current Python 3.14 / Pyodide toolchain. A targeted fork CI run built the wheel and passed the recipe's runtime test in Chrome, Firefox, and Node:
https://github.com/metalmancode/pyodide-recipes/actions/runs/29262798470
The runtime test creates a small ONNX graph, validates it through the compiled checker, serializes it, loads it back, and validates the restored model.
Related work: #463 targets ONNX 1.20.0 but currently has a failing build. This pull request intentionally starts from the independently reproduced and current-toolchain-validated 1.15.0 baseline rather than claiming unverified 1.20.0 support.
Provenance
The port and browser proof were created by Gholamreza Rashidi Ardestani (
@metalmancode) from the browser-local ONNX export work used in MLDeck.