Skip to content

feat: support the wasm32-unknown-emscripten target - #8281

Open
guybedford wants to merge 3 commits into
tokio-rs:masterfrom
guybedford:emscripten-target
Open

feat: support the wasm32-unknown-emscripten target#8281
guybedford wants to merge 3 commits into
tokio-rs:masterfrom
guybedford:emscripten-target

Conversation

@guybedford

@guybedford guybedford commented Jul 14, 2026

Copy link
Copy Markdown

Motivation

Tokio does not yet support the wasm32-unknown-emscripten target, which is widely used in the WebAssembly ecosystem. This PR initiates a first step towards that.

Solution

Supports the single-threaded wasm32-unknown-emscripten with wasm32-unknown-unknown parity: sync, macros, io-util, rt, time, and test-util compile and work. process/signal are compiled out (no fork/exec or kernel signal delivery) and the multi_thread flavor is rejected. net remains unsupported (pending the Mio PR in tokio-rs/mio#1969).

This is just an initial minimal target support PR, to follow-up on next with the JSPI-based parking and hosted event loop models afterwards. As such, it has no execution-model changes and no design decisions beyond existing Wasm target policy. A block_on whose future cannot resolve synchronously behaves as on the other single-threaded Wasm targets.

CI runs the sync/macros test surface under Node.js, just like wasm-bindgen-test, and checks every supported feature combination for the target.

//cc @Darksonn @Noah-Kennedy

@github-actions github-actions Bot added R-loom-sync Run loom sync tests on this PR R-loom-time-driver Run loom time driver tests on this PR labels Jul 14, 2026
@guybedford
guybedford force-pushed the emscripten-target branch 2 times, most recently from 72ff20b to 6cc89cc Compare July 15, 2026 00:10
@Darksonn Darksonn added A-tokio Area: The main tokio crate T-wasm Topic: Web Assembly labels Jul 15, 2026
Comment thread tokio/src/time/mod.rs Outdated
Comment thread tokio-macros/src/entry.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tokio Area: The main tokio crate R-loom-sync Run loom sync tests on this PR R-loom-time-driver Run loom time driver tests on this PR T-wasm Topic: Web Assembly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants