From 915fd493a17784f2171d941becb5775103e4246d Mon Sep 17 00:00:00 2001 From: Andrew Weston Date: Tue, 25 Nov 2025 11:34:18 +1300 Subject: [PATCH 1/3] fix feature flag (#1) --- crates/wasip3/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/wasip3/Cargo.toml b/crates/wasip3/Cargo.toml index dff0c16..99f25c2 100644 --- a/crates/wasip3/Cargo.toml +++ b/crates/wasip3/Cargo.toml @@ -22,7 +22,7 @@ http-compat = [ [dependencies] # NB: async bindings require `std` right now so this doesn't optionally disable # `std`, it's intentionally always enabled. -wit-bindgen = { workspace = true, features = ['async'] } +wit-bindgen = { workspace = true, features = ['async-spawn'] } # Optional dependencies for extending http types. bytes = { version = "1.10.1", optional = true } http-body = { version = "1.0.1", optional = true } From cd11205d8f83ce4991dc93c146d722413ec18eed Mon Sep 17 00:00:00 2001 From: Andrew Weston Date: Thu, 27 Nov 2025 11:33:03 +1300 Subject: [PATCH 2/3] Feature flag (#2) * fix feature flag * only turn on async-spawn feature when using http-compat * add CI check for http-compat feature * revert inadvertent format changes --- .github/workflows/main.yml | 7 ++++++- crates/wasip3/Cargo.toml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 847f3f0..d094dfd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,6 @@ jobs: - run: wasmtime run ./target/wasm32-wasip2/debug/examples/hello-world.wasm - run: wasmtime run ./target/wasm32-wasip2/debug/examples/cli_command.wasm - - run: cargo build -p wasip2 --examples --target wasm32-unknown-unknown --no-default-features - run: wasm-tools component new ./target/wasm32-unknown-unknown/debug/examples/http_proxy_no_std.wasm -o component.wasm - run: wasm-tools component targets ./crates/wasip2/wit component.wasm -w wasi:http/proxy @@ -139,6 +138,12 @@ jobs: - run: cargo build -p wasip3 --examples --target wasm32-wasip2 - run: wasmtime run -Sp3 -Wcomponent-model-async ./target/wasm32-wasip2/debug/examples/cli_command.wasm + + # The http-proxy-compat example requires the 'http-compat' feature + # - check that 'http_proxy_compat.wasm' was not built in the previous step + - run: if [ -f ./target/wasm32-wasip2/debug/examples/http_proxy_compat.wasm ]; then exit 1; fi + - run: cargo build -p wasip3 --features http-compat --example http-proxy-compat --target wasm32-wasip2 + - run: wasmtime run -Sp3 -Wcomponent-model-async ./target/wasm32-wasip2/debug/examples/http_proxy_compat.wasm - run: cargo build -p wasip3 --examples --target wasm32-unknown-unknown - run: wasm-tools component new ./target/wasm32-unknown-unknown/debug/examples/http_proxy.wasm -o component.wasm diff --git a/crates/wasip3/Cargo.toml b/crates/wasip3/Cargo.toml index 99f25c2..f63de63 100644 --- a/crates/wasip3/Cargo.toml +++ b/crates/wasip3/Cargo.toml @@ -17,6 +17,7 @@ http-compat = [ "dep:http-body", "dep:http", "dep:thiserror", + "wit-bindgen/async-spawn", ] [dependencies] From 36542877936ef2e67b488a8df93187338813dfc8 Mon Sep 17 00:00:00 2001 From: Andrew Weston Date: Thu, 27 Nov 2025 13:22:15 +1300 Subject: [PATCH 3/3] Fix CI (#3) * revert async-spawn -> async * simplify ci * trigger workflow * update generated code * revert generated code * bump wit-bindgen version in ci * update generated code * revert generated code * use wasm-tools to run component * use wasm-tools to run component * use wasm-tools to run component * debug ci issue * debug ci issue * debug ci issue * debug ci issue * debug ci issue * debug ci issue * fix fmt --- .github/workflows/main.yml | 10 ++++------ crates/wasip3/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d094dfd..21a6747 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -138,12 +138,10 @@ jobs: - run: cargo build -p wasip3 --examples --target wasm32-wasip2 - run: wasmtime run -Sp3 -Wcomponent-model-async ./target/wasm32-wasip2/debug/examples/cli_command.wasm - - # The http-proxy-compat example requires the 'http-compat' feature - # - check that 'http_proxy_compat.wasm' was not built in the previous step - - run: if [ -f ./target/wasm32-wasip2/debug/examples/http_proxy_compat.wasm ]; then exit 1; fi - - run: cargo build -p wasip3 --features http-compat --example http-proxy-compat --target wasm32-wasip2 - - run: wasmtime run -Sp3 -Wcomponent-model-async ./target/wasm32-wasip2/debug/examples/http_proxy_compat.wasm + + - run: cargo build -p wasip3 --example http-proxy-compat --target wasm32-unknown-unknown --features http-compat + - run: wasm-tools component new ./target/wasm32-unknown-unknown/debug/examples/http_proxy_compat.wasm -o component.wasm + - run: wasm-tools component targets ./crates/wasip3/wit component.wasm -w wasi:http/proxy - run: cargo build -p wasip3 --examples --target wasm32-unknown-unknown - run: wasm-tools component new ./target/wasm32-unknown-unknown/debug/examples/http_proxy.wasm -o component.wasm diff --git a/crates/wasip3/Cargo.toml b/crates/wasip3/Cargo.toml index f63de63..cfadb6e 100644 --- a/crates/wasip3/Cargo.toml +++ b/crates/wasip3/Cargo.toml @@ -23,7 +23,7 @@ http-compat = [ [dependencies] # NB: async bindings require `std` right now so this doesn't optionally disable # `std`, it's intentionally always enabled. -wit-bindgen = { workspace = true, features = ['async-spawn'] } +wit-bindgen = { workspace = true, features = ['async'] } # Optional dependencies for extending http types. bytes = { version = "1.10.1", optional = true } http-body = { version = "1.0.1", optional = true }