ci: Build WebAssembly (wasm32-unknown-emscripten) wheels#1788
Draft
aborgna-q wants to merge 1 commit into
Draft
Conversation
Add a `wasm` job to the python-wheels workflow that cross-compiles the tket Python extension to `wasm32-unknown-emscripten`, producing pyodide-compatible wheels. - build.rs: recognise the emscripten target and skip linking a system `stdc++` (the `em++` linker driver provides its own libc++). The wasm tket-c-api archive is consumed via TKET_C_API_PATH. - python-wheels.yml: new `wasm` job using nightly Rust with `-Zbuild-std`, emsdk 5.0.3 and Python 3.14, fetching the prebuilt emscripten tket-c-api from hugrverse-env via the install-hugrenv-action `target: emscripten_wasm32` input. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1788 +/- ##
==========================================
- Coverage 85.57% 85.56% -0.02%
==========================================
Files 197 197
Lines 30964 30964
Branches 29528 29528
==========================================
- Hits 26497 26493 -4
- Misses 3192 3195 +3
- Partials 1275 1276 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Warning
Summary
Adds a
wasmjob to the Python wheels workflow that cross-compiles the tket Python extension towasm32-unknown-emscripten, producing pyodide-compatible WebAssembly wheels. Implements #1415.Targets Emscripten 5.0.3 / Python 3.14 (pyodide
pyemscripten_2026_0ABI), mirroring the proven hugr wasm-wheel pipeline.Changes
tket1-passes/build.rs: recognise the emscripten target (SupportedPlatform::Emscripten) and skip linking a systemstdc++— theem++linker driver provides its own libc++. The wasmtket-c-apistatic archive is consumed viaTKET_C_API_PATH..github/workflows/python-wheels.yml: newwasmjob — nightly Rust with-Zbuild-std, emsdk 5.0.3, Python 3.14 — that fetches the prebuilt emscriptentket-c-apifrom hugrverse-env viainstall-hugrenv-actionwith the newtarget: emscripten_wasm32input (andpackages: tket, since llvm has no wasm build).Dependencies / sequencing
emscripten_wasm32build + thetargetaction input). Before the wasm job can succeed:main.hugrenv-tket-emscripten_wasm32.tar.gzasset.hugrenv.lockversion points at that release.Note: the wheels workflow only triggers on push to
main, tags, orworkflow_dispatch(not on PRs), so this PR won't build wheels on its own.Open questions / known limitations
par_iter_mutpaths won't work under single-threaded wasm; may need a feature-flag/fallback.wasmjob is intentionally not added to the releaseneedsyet, pending a decision on whether to publish emscripten wheels to PyPI.Draft — pending hugrverse-env#15.