ci: Build WebAssembly (wasm32-unknown-emscripten) wheels - #1788
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1788 +/- ##
==========================================
- Coverage 86.60% 86.60% -0.01%
==========================================
Files 202 202
Lines 32644 32679 +35
Branches 31158 31193 +35
==========================================
+ Hits 28271 28301 +30
- Misses 3089 3092 +3
- Partials 1284 1286 +2
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:
|
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>
aborgna-q
force-pushed
the
agents/wasm-wheels
branch
from
August 20, 2026 16:57
62a2c94 to
9123464
Compare
aborgna-q
force-pushed
the
agents/wasm-wheels
branch
from
August 20, 2026 17:08
b6d9bc9 to
493db67
Compare
aborgna-q
force-pushed
the
agents/wasm-wheels
branch
from
August 20, 2026 18:38
6866c89 to
ee1d4f7
Compare
aborgna-q
force-pushed
the
agents/wasm-wheels
branch
from
August 21, 2026 09:27
adad1fd to
e4fb182
Compare
doug-q
approved these changes
Aug 24, 2026
doug-q
left a comment
Contributor
There was a problem hiding this comment.
Looks good, just a couple comments
| .convert_pyerrs()?; | ||
| // Emscripten wheels are built with `rayon` disabled, so we need to run the | ||
| // pass sequentially in that case. | ||
| if cfg!(target_os = "emscripten") { |
Contributor
There was a problem hiding this comment.
This is a weird way to do it. Rayon doesn't look like it's disabled in Cargo.toml.
Collaborator
Author
There was a problem hiding this comment.
Yeah, it's mostly that running par_iter_mut on emscripten fails at runtime:
The global thread pool has not been initialized:
ThreadPoolBuildError {
kind: IOError(Os {
code: 6,
kind: WouldBlock,
message: "Resource temporarily unavailable"
})
}
I'll update the comment
cqc-alec
approved these changes
Aug 24, 2026
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
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
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 4.0.9 / Python 3.13 (pyodide
pyemscripten_2025_0ABI), to match hugr's wasm wheelsI tested these locally with emscripten, and in a guppy-playpond instance.
Note that the
pytketpython wheel is not available in WASM, buttket's pytket-based pass work correctly as they use an internally compiledtket-c-api.Wheel building run: https://github.com/Quantinuum/tket2/actions/runs/33096483912/job/98602665474