Skip to content

Commit 6d3f92d

Browse files
authoredJul 12, 2022
wasm: initial support for wasm32-wasi target (#4716)
This adds initial, unstable, support for the wasm32-wasi target. Not all of Tokio's features are supported yet as WASI's non-blocking APIs are still limited. Refs: #4827
1 parent be620e9 commit 6d3f92d

File tree

103 files changed

+696
-411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+696
-411
lines changed
 

‎.github/workflows/ci.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,23 @@ jobs:
489489
- name: Install cargo-wasi
490490
run: cargo install cargo-wasi
491491

492-
# TODO: Expand this when full WASI support lands.
493-
# Currently, this is a bare bones regression test
494-
# for features that work today with wasi.
492+
- name: WASI test tokio full
493+
run: cargo test -p tokio --target wasm32-wasi --features full
494+
env:
495+
CARGO_TARGET_WASM32_WASI_RUNNER: "wasmtime run --"
496+
RUSTFLAGS: --cfg tokio_unstable -Dwarnings
497+
498+
- name: WASI test tokio-util full
499+
run: cargo test -p tokio-util --target wasm32-wasi --features full
500+
env:
501+
CARGO_TARGET_WASM32_WASI_RUNNER: "wasmtime run --"
502+
RUSTFLAGS: --cfg tokio_unstable -Dwarnings
503+
504+
- name: WASI test tokio-stream
505+
run: cargo test -p tokio-stream --target wasm32-wasi --features time,net,io-util,sync
506+
env:
507+
CARGO_TARGET_WASM32_WASI_RUNNER: "wasmtime run --"
508+
RUSTFLAGS: --cfg tokio_unstable -Dwarnings
495509

496510
- name: test tests-integration --features wasi-rt
497511
# TODO: this should become: `cargo hack wasi test --each-feature`

‎tests-integration/tests/macros_main.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
#![cfg(all(feature = "macros", feature = "rt-multi-thread"))]
1+
#![cfg(all(
2+
feature = "macros",
3+
feature = "rt-multi-thread",
4+
not(target_os = "wasi")
5+
))]
26

37
#[tokio::main]
48
async fn basic_main() -> usize {

0 commit comments

Comments
 (0)
Please sign in to comment.