From 11a56092edf9e48da2d6c65f3dbd12f526c536bc Mon Sep 17 00:00:00 2001 From: Adam Bratschi-Kaye Date: Thu, 19 Nov 2026 15:31:23 -0500 Subject: [PATCH] test: Enable p3 testing on stable This is possible now that the p3 target is on stable. Also bumps the MSRV to 1.100.0 where p3 is enabled. --- .github/actions/install-rust/action.yml | 9 +---- .github/workflows/ci.yaml | 8 ---- Cargo.toml | 2 +- rust-toolchain.toml | 2 +- test-programs/build.rs | 49 ++---------------------- test-programs/tests/axum_hello_world.rs | 2 - test-programs/tests/axum_weather.rs | 3 +- test-programs/tests/http_server.rs | 1 - test-programs/tests/http_server_proxy.rs | 1 - test-programs/tests/stdio.rs | 1 - test-programs/tests/tcp_echo_server.rs | 1 - test-programs/tests/tcp_stream_client.rs | 1 - test-programs/tests/udp_echo_server.rs | 1 - test-programs/tests/udp_stream_client.rs | 1 - 14 files changed, 9 insertions(+), 73 deletions(-) diff --git a/.github/actions/install-rust/action.yml b/.github/actions/install-rust/action.yml index 099c0dc3..678b895e 100644 --- a/.github/actions/install-rust/action.yml +++ b/.github/actions/install-rust/action.yml @@ -33,13 +33,8 @@ runs: # override` has higher precedence though. rustup override set "${{ steps.select.outputs.version }}" - rustup target add wasm32-wasip2 - - if [ "${{ inputs.toolchain }}" = "nightly" ]; then - rustup target add wasm32-wasip3 - rustup component add rustfmt - rustup component add clippy - fi + rustup target add wasm32-wasip2 wasm32-wasip3 + rustup component add rustfmt clippy # Save disk space by avoiding incremental compilation. Also turn down # debuginfo from 2 to 0 to help save disk space. diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 35e38e6d..8e44ebb7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,17 +54,13 @@ jobs: - name: check p2 run: cargo check --workspace --all --bins --examples --target wasm32-wasip2 - # TODO: remove all nightly conditions for p3 targets once wasm32-wasip3 is - # stable. - name: check p3 - if: matrix.rust == 'nightly' run: cargo check --workspace --all --bins --examples --target wasm32-wasip3 - name: wstd p2 tests run: cargo test -p wstd -p wstd-axum --target wasm32-wasip2 -- --nocapture - name: wstd p3 tests - if: matrix.rust == 'nightly' run: cargo test -p wstd -p wstd-axum --target wasm32-wasip3 -- --nocapture - name: test-programs tests @@ -81,8 +77,6 @@ jobs: steps: - uses: actions/checkout@master - uses: ./.github/actions/install-rust - with: - toolchain: nightly - name: fmt run: cargo fmt --all -- --check @@ -105,8 +99,6 @@ jobs: steps: - uses: actions/checkout@master - uses: ./.github/actions/install-rust - with: - toolchain: nightly - run: rustc ci/publish.rs # Make sure we can bump version numbers for the next release - run: ./publish bump diff --git a/Cargo.toml b/Cargo.toml index 7ee77cda..ceaeaa10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ license = "Apache-2.0 WITH LLVM-exception" repository = "https://github.com/bytecodealliance/wstd" keywords = ["WebAssembly", "async", "stdlib", "Components"] categories = ["wasm", "asynchronous"] -rust-version = "1.92.0" +rust-version = "1.100.0" authors = [ "Yoshua Wuyts ", "Pat Hickey ", diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 71c5e6e3..09f2c559 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] channel = "stable" -targets = ["wasm32-wasip2"] +targets = ["wasm32-wasip2", "wasm32-wasip3"] diff --git a/test-programs/build.rs b/test-programs/build.rs index cb818114..0f6b874a 100644 --- a/test-programs/build.rs +++ b/test-programs/build.rs @@ -6,7 +6,6 @@ use std::process::Command; fn main() { let out_dir = PathBuf::from(var_os("OUT_DIR").expect("OUT_DIR env var exists")); - let nightly_toolchain = is_nightly_toolchain(); let meta = MetadataCommand::new() .exec() @@ -17,13 +16,6 @@ fn main() { meta.workspace_root.as_os_str().to_str().unwrap() ); - // TODO: Remove this nightly only cfg once wasm32-wasip3 is available on - // stable. - println!("cargo::rustc-check-cfg=cfg(wstd_nightly)"); - if nightly_toolchain { - println!("cargo:rustc-cfg=wstd_nightly"); - } - fn build_target(pkg: &str, manifest: &str, kind: &str, target: &str, out_dir: &Path) { // release build is required for aws sdk to not overflow wasm locals let status = Command::new("cargo") @@ -42,34 +34,16 @@ fn main() { assert!(status.success()); } - fn build_targets( - pkg: &str, - manifest: &str, - kind: &str, - nightly_toolchain: bool, - out_dir: &Path, - ) { + fn build_targets(pkg: &str, manifest: &str, kind: &str, build_p3: bool, out_dir: &Path) { build_target(pkg, manifest, kind, "wasm32-wasip2", out_dir); - if nightly_toolchain { + if build_p3 { build_target(pkg, manifest, kind, "wasm32-wasip3", out_dir); } } - build_targets( - "wstd", - "../Cargo.toml", - "--examples", - nightly_toolchain, - &out_dir, - ); - build_targets( - "wstd-axum", - "../Cargo.toml", - "--examples", - nightly_toolchain, - &out_dir, - ); + build_targets("wstd", "../Cargo.toml", "--examples", true, &out_dir); + build_targets("wstd-axum", "../Cargo.toml", "--examples", true, &out_dir); build_targets( "wstd-aws-example", "../aws-example/Cargo.toml", @@ -152,21 +126,6 @@ fn main() { std::fs::write(out_dir.join("gen.rs"), generated_code).unwrap(); } -fn is_nightly_toolchain() -> bool { - let rustc = var_os("RUSTC").unwrap_or_else(|| "rustc".into()); - let output = Command::new(rustc) - .arg("--version") - .output() - .expect("query active rustc version"); - assert!( - output.status.success(), - "failed to query active rustc version" - ); - String::from_utf8(output.stdout) - .expect("rustc version is UTF-8") - .contains("-nightly") -} - fn rustflags() -> &'static str { match option_env!("RUSTFLAGS") { Some(s) if s.contains("-D warnings") => "-D warnings", diff --git a/test-programs/tests/axum_hello_world.rs b/test-programs/tests/axum_hello_world.rs index c53ce64e..31f7d9aa 100644 --- a/test-programs/tests/axum_hello_world.rs +++ b/test-programs/tests/axum_hello_world.rs @@ -5,7 +5,6 @@ fn hello_world() -> Result<()> { run(test_programs::axum::HELLO_WORLD) } -#[cfg(wstd_nightly)] #[test_log::test] fn hello_world_p3() -> Result<()> { run(test_programs::axum::HELLO_WORLD_P3) @@ -16,7 +15,6 @@ fn hello_world_nomacro() -> Result<()> { run(test_programs::axum::HELLO_WORLD_NOMACRO) } -#[cfg(wstd_nightly)] #[test_log::test] fn hello_world_nomacro_p3() -> Result<()> { run(test_programs::axum::HELLO_WORLD_NOMACRO_P3) diff --git a/test-programs/tests/axum_weather.rs b/test-programs/tests/axum_weather.rs index 0c1fefc9..f2b3f3ca 100644 --- a/test-programs/tests/axum_weather.rs +++ b/test-programs/tests/axum_weather.rs @@ -9,8 +9,7 @@ fn weather() -> Result<()> { run(test_programs::axum::WEATHER) } -#[cfg(wstd_nightly)] -#[cfg_attr(wstd_nightly, ignore)] +#[ignore] #[test_log::test] fn weather_p3() -> Result<()> { run(test_programs::axum::WEATHER_P3) diff --git a/test-programs/tests/http_server.rs b/test-programs/tests/http_server.rs index 5ffc7d1b..0bf9c19e 100644 --- a/test-programs/tests/http_server.rs +++ b/test-programs/tests/http_server.rs @@ -6,7 +6,6 @@ fn http_server() -> Result<()> { run(test_programs::HTTP_SERVER) } -#[cfg(wstd_nightly)] #[test_log::test] fn http_server_p3() -> Result<()> { run(test_programs::HTTP_SERVER_P3) diff --git a/test-programs/tests/http_server_proxy.rs b/test-programs/tests/http_server_proxy.rs index 6187bc5b..710d9826 100644 --- a/test-programs/tests/http_server_proxy.rs +++ b/test-programs/tests/http_server_proxy.rs @@ -5,7 +5,6 @@ fn http_server_proxy() -> Result<()> { run(test_programs::HTTP_SERVER, test_programs::HTTP_SERVER_PROXY) } -#[cfg(wstd_nightly)] #[test_log::test] fn http_server_proxy_p3() -> Result<()> { run( diff --git a/test-programs/tests/stdio.rs b/test-programs/tests/stdio.rs index d5d20b36..ad79052d 100644 --- a/test-programs/tests/stdio.rs +++ b/test-programs/tests/stdio.rs @@ -54,7 +54,6 @@ fn stdio_p2() -> Result<()> { run(test_programs::STDIO, false) } -#[cfg(wstd_nightly)] #[test_log::test] fn stdio_p3() -> Result<()> { run(test_programs::STDIO_P3, true) diff --git a/test-programs/tests/tcp_echo_server.rs b/test-programs/tests/tcp_echo_server.rs index befcc185..f08e8d7b 100644 --- a/test-programs/tests/tcp_echo_server.rs +++ b/test-programs/tests/tcp_echo_server.rs @@ -91,7 +91,6 @@ fn tcp_echo_server_p2() -> Result<()> { run(test_programs::TCP_ECHO_SERVER, false) } -#[cfg(wstd_nightly)] #[test_log::test] fn tcp_echo_server_p3() -> Result<()> { run(test_programs::TCP_ECHO_SERVER_P3, true) diff --git a/test-programs/tests/tcp_stream_client.rs b/test-programs/tests/tcp_stream_client.rs index 3725ab9b..ee3d83c4 100644 --- a/test-programs/tests/tcp_stream_client.rs +++ b/test-programs/tests/tcp_stream_client.rs @@ -59,7 +59,6 @@ fn tcp_stream_client_p2() -> Result<()> { run(test_programs::TCP_STREAM_CLIENT, false) } -#[cfg(wstd_nightly)] #[test_log::test] fn tcp_stream_client_p3() -> Result<()> { run(test_programs::TCP_STREAM_CLIENT_P3, true) diff --git a/test-programs/tests/udp_echo_server.rs b/test-programs/tests/udp_echo_server.rs index 137597df..ebf45873 100644 --- a/test-programs/tests/udp_echo_server.rs +++ b/test-programs/tests/udp_echo_server.rs @@ -72,7 +72,6 @@ fn udp_echo_server_p2() -> Result<()> { run(test_programs::UDP_ECHO_SERVER, false) } -#[cfg(wstd_nightly)] #[test_log::test] fn udp_echo_server_p3() -> Result<()> { run(test_programs::UDP_ECHO_SERVER_P3, true) diff --git a/test-programs/tests/udp_stream_client.rs b/test-programs/tests/udp_stream_client.rs index 565854f8..f8f9c008 100644 --- a/test-programs/tests/udp_stream_client.rs +++ b/test-programs/tests/udp_stream_client.rs @@ -62,7 +62,6 @@ fn udp_stream_client_p2() -> Result<()> { run(test_programs::UDP_STREAM_CLIENT, false) } -#[cfg(wstd_nightly)] #[test_log::test] fn udp_stream_client_p3() -> Result<()> { run(test_programs::UDP_STREAM_CLIENT_P3, true)