From 8fc6cb71fd6ba140f8780f2f86d54292287676be Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 11 Jun 2026 12:20:15 -0700 Subject: [PATCH 1/3] Update WASI to 0.3.0, enable component-model-async This commit updates the vendored WASI WITs for the 0.3.0 release of WASI to this repository, updating the supported version of WASI that `wasmtime-wasi` runs. This additionally enables the `component-model-async` wasm feature by default in Wasmtime, along with `-Sp3` on the CLI as well. This is intended to be a comprehensive "turn WASI 0.3.0 on by default" PR which touches a few different locations. Apart from changing version numbers some minor changes made here are: * Default enablement of the wasm `cm-async` feature is now conditional on `Config::concurrency_support` in addition to the compile-time feature. This means that if `concurrency_support` is disabled the default will be that `cm-async` is disabled. * The `tests/wasi.rs` test suite running the upstream `wasi-testsuite` repository is updated to expect failures for all WASIp3 tests due to the import versions changing. This resulted in a necessary restructuring of the test to handle a few more failures in a few more locations to ensure that "should fail tests" are correctly marked as passing when they indeed do fail. --- ci/vendor-wit.sh | 2 +- .../src/bin/p3_cli_many_tasks.rs | 2 +- .../src/bin/p3_http_middleware.rs | 26 +-- .../src/bin/p3_http_middleware_with_chain.rs | 28 +-- .../src/bin/p3_sockets_tcp_busy_poll.rs | 2 +- crates/test-programs/src/p3/mod.rs | 36 ++-- crates/wasi-http/src/p3/wit/deps/cli.wit | 156 ++++++++--------- crates/wasi-http/src/p3/wit/deps/clocks.wit | 34 ++-- .../wasi-http/src/p3/wit/deps/filesystem.wit | 104 +++++------ crates/wasi-http/src/p3/wit/deps/http.wit | 92 +++++----- crates/wasi-http/src/p3/wit/deps/random.wit | 26 +-- crates/wasi-http/src/p3/wit/deps/sockets.wit | 128 +++++++------- crates/wasi-http/src/p3/wit/world.wit | 2 +- crates/wasi-http/tests/all/p3/mod.rs | 2 +- crates/wasi/src/p3/bindings.rs | 2 +- crates/wasi/src/p3/cli/mod.rs | 14 +- crates/wasi/src/p3/mod.rs | 4 +- crates/wasi/src/p3/wit/deps/cli.wit | 156 ++++++++--------- crates/wasi/src/p3/wit/deps/clocks.wit | 34 ++-- crates/wasi/src/p3/wit/deps/filesystem.wit | 104 +++++------ crates/wasi/src/p3/wit/deps/random.wit | 26 +-- crates/wasi/src/p3/wit/deps/sockets.wit | 128 +++++++------- crates/wasmtime/src/config.rs | 6 + src/common.rs | 5 +- tests/wasi.rs | 161 ++++++++++-------- 25 files changed, 646 insertions(+), 634 deletions(-) diff --git a/ci/vendor-wit.sh b/ci/vendor-wit.sh index 44b7df5e2c70..c912cfbe9f11 100755 --- a/ci/vendor-wit.sh +++ b/ci/vendor-wit.sh @@ -36,7 +36,7 @@ get_github() { } p2=0.2.12 -p3=0.3.0-rc-2026-03-15 +p3=0.3.0 rm -rf crates/wasi-io/wit/deps mkdir -p crates/wasi-io/wit/deps diff --git a/crates/test-programs/src/bin/p3_cli_many_tasks.rs b/crates/test-programs/src/bin/p3_cli_many_tasks.rs index f7b161ac6bb1..ceafa7ce2ca6 100644 --- a/crates/test-programs/src/bin/p3_cli_many_tasks.rs +++ b/crates/test-programs/src/bin/p3_cli_many_tasks.rs @@ -1,6 +1,6 @@ use test_programs::p3::wasi as wasip3; -#[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15")] +#[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.3.0")] unsafe extern "C" { #[link_name = "[async-lower]wait-for"] fn wait_for(dur: u64) -> u32; diff --git a/crates/test-programs/src/bin/p3_http_middleware.rs b/crates/test-programs/src/bin/p3_http_middleware.rs index 400ba6bce38b..c83bcf90f541 100644 --- a/crates/test-programs/src/bin/p3_http_middleware.rs +++ b/crates/test-programs/src/bin/p3_http_middleware.rs @@ -18,19 +18,19 @@ wit_bindgen::generate!({ path: "../wasi-http/src/p3/wit", world: "wasi:http/middleware", with: { - "wasi:http/handler@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::handler, - "wasi:http/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::types, - "wasi:http/client@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::client, - "wasi:random/random@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::random, - "wasi:random/insecure@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure, - "wasi:random/insecure-seed@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure_seed, - "wasi:cli/stdout@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdout, - "wasi:cli/stderr@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stderr, - "wasi:cli/stdin@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdin, - "wasi:cli/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::types, - "wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::monotonic_clock, - "wasi:clocks/system-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::system_clock, - "wasi:clocks/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::types, + "wasi:http/handler@0.3.0": test_programs::p3::wasi::http::handler, + "wasi:http/types@0.3.0": test_programs::p3::wasi::http::types, + "wasi:http/client@0.3.0": test_programs::p3::wasi::http::client, + "wasi:random/random@0.3.0": test_programs::p3::wasi::random::random, + "wasi:random/insecure@0.3.0": test_programs::p3::wasi::random::insecure, + "wasi:random/insecure-seed@0.3.0": test_programs::p3::wasi::random::insecure_seed, + "wasi:cli/stdout@0.3.0": test_programs::p3::wasi::cli::stdout, + "wasi:cli/stderr@0.3.0": test_programs::p3::wasi::cli::stderr, + "wasi:cli/stdin@0.3.0": test_programs::p3::wasi::cli::stdin, + "wasi:cli/types@0.3.0": test_programs::p3::wasi::cli::types, + "wasi:clocks/monotonic-clock@0.3.0": test_programs::p3::wasi::clocks::monotonic_clock, + "wasi:clocks/system-clock@0.3.0": test_programs::p3::wasi::clocks::system_clock, + "wasi:clocks/types@0.3.0": test_programs::p3::wasi::clocks::types, }, }); diff --git a/crates/test-programs/src/bin/p3_http_middleware_with_chain.rs b/crates/test-programs/src/bin/p3_http_middleware_with_chain.rs index cf14e3532b99..fbc71a5820f3 100644 --- a/crates/test-programs/src/bin/p3_http_middleware_with_chain.rs +++ b/crates/test-programs/src/bin/p3_http_middleware_with_chain.rs @@ -6,13 +6,13 @@ mod bindings { package local:local; world middleware-with-chain { - include wasi:http/service@0.3.0-rc-2026-03-15; + include wasi:http/service@0.3.0; import chain-http; } interface chain-http { - use wasi:http/types@0.3.0-rc-2026-03-15.{request, response, error-code}; + use wasi:http/types@0.3.0.{request, response, error-code}; handle: async func(request: request) -> result; } @@ -20,18 +20,18 @@ interface chain-http { // workaround https://github.com/bytecodealliance/wit-bindgen/issues/1544 // generate_all with: { - "wasi:http/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::types, - "wasi:http/client@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::client, - "wasi:random/random@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::random, - "wasi:random/insecure@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure, - "wasi:random/insecure-seed@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure_seed, - "wasi:cli/stdout@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdout, - "wasi:cli/stderr@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stderr, - "wasi:cli/stdin@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdin, - "wasi:cli/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::types, - "wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::monotonic_clock, - "wasi:clocks/system-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::system_clock, - "wasi:clocks/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::types, + "wasi:http/types@0.3.0": test_programs::p3::wasi::http::types, + "wasi:http/client@0.3.0": test_programs::p3::wasi::http::client, + "wasi:random/random@0.3.0": test_programs::p3::wasi::random::random, + "wasi:random/insecure@0.3.0": test_programs::p3::wasi::random::insecure, + "wasi:random/insecure-seed@0.3.0": test_programs::p3::wasi::random::insecure_seed, + "wasi:cli/stdout@0.3.0": test_programs::p3::wasi::cli::stdout, + "wasi:cli/stderr@0.3.0": test_programs::p3::wasi::cli::stderr, + "wasi:cli/stdin@0.3.0": test_programs::p3::wasi::cli::stdin, + "wasi:cli/types@0.3.0": test_programs::p3::wasi::cli::types, + "wasi:clocks/monotonic-clock@0.3.0": test_programs::p3::wasi::clocks::monotonic_clock, + "wasi:clocks/system-clock@0.3.0": test_programs::p3::wasi::clocks::system_clock, + "wasi:clocks/types@0.3.0": test_programs::p3::wasi::clocks::types, }, }); diff --git a/crates/test-programs/src/bin/p3_sockets_tcp_busy_poll.rs b/crates/test-programs/src/bin/p3_sockets_tcp_busy_poll.rs index 6583eed0df48..e23370edc6fe 100644 --- a/crates/test-programs/src/bin/p3_sockets_tcp_busy_poll.rs +++ b/crates/test-programs/src/bin/p3_sockets_tcp_busy_poll.rs @@ -11,7 +11,7 @@ use test_programs::p3::wit_stream; use test_programs::sockets::supports_ipv6; use wit_bindgen::StreamResult; -#[link(wasm_import_module = "wasi:http/types@0.3.0-rc-2026-03-15")] +#[link(wasm_import_module = "wasi:http/types@0.3.0")] unsafe extern "C" { #[link_name = "[async-lower][stream-read-0][static]request.new"] fn stream_read(_: u32, _: *mut u8, _: usize) -> u32; diff --git a/crates/test-programs/src/p3/mod.rs b/crates/test-programs/src/p3/mod.rs index 9e49bb1c1952..abe3ebd048c1 100644 --- a/crates/test-programs/src/p3/mod.rs +++ b/crates/test-programs/src/p3/mod.rs @@ -6,13 +6,13 @@ wit_bindgen::generate!({ package wasmtime:test; world testp3 { - include wasi:cli/imports@0.3.0-rc-2026-03-15; + include wasi:cli/imports@0.3.0; include wasi:tls/imports@0.3.0-draft; - import wasi:http/types@0.3.0-rc-2026-03-15; - import wasi:http/client@0.3.0-rc-2026-03-15; - import wasi:http/handler@0.3.0-rc-2026-03-15; + import wasi:http/types@0.3.0; + import wasi:http/client@0.3.0; + import wasi:http/handler@0.3.0; - export wasi:cli/run@0.3.0-rc-2026-03-15; + export wasi:cli/run@0.3.0; } ", path: [ @@ -32,19 +32,19 @@ pub mod service { default_bindings_module: "test_programs::p3::service", pub_export_macro: true, with: { - "wasi:http/handler@0.3.0-rc-2026-03-15": crate::p3::wasi::http::handler, - "wasi:http/types@0.3.0-rc-2026-03-15": crate::p3::wasi::http::types, - "wasi:http/client@0.3.0-rc-2026-03-15": crate::p3::wasi::http::client, - "wasi:random/random@0.3.0-rc-2026-03-15": crate::p3::wasi::random::random, - "wasi:random/insecure@0.3.0-rc-2026-03-15": crate::p3::wasi::random::insecure, - "wasi:random/insecure-seed@0.3.0-rc-2026-03-15": crate::p3::wasi::random::insecure_seed, - "wasi:cli/stdout@0.3.0-rc-2026-03-15": crate::p3::wasi::cli::stdout, - "wasi:cli/stderr@0.3.0-rc-2026-03-15": crate::p3::wasi::cli::stderr, - "wasi:cli/stdin@0.3.0-rc-2026-03-15": crate::p3::wasi::cli::stdin, - "wasi:cli/types@0.3.0-rc-2026-03-15": crate::p3::wasi::cli::types, - "wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15": crate::p3::wasi::clocks::monotonic_clock, - "wasi:clocks/system-clock@0.3.0-rc-2026-03-15": crate::p3::wasi::clocks::system_clock, - "wasi:clocks/types@0.3.0-rc-2026-03-15": crate::p3::wasi::clocks::types, + "wasi:http/handler@0.3.0": crate::p3::wasi::http::handler, + "wasi:http/types@0.3.0": crate::p3::wasi::http::types, + "wasi:http/client@0.3.0": crate::p3::wasi::http::client, + "wasi:random/random@0.3.0": crate::p3::wasi::random::random, + "wasi:random/insecure@0.3.0": crate::p3::wasi::random::insecure, + "wasi:random/insecure-seed@0.3.0": crate::p3::wasi::random::insecure_seed, + "wasi:cli/stdout@0.3.0": crate::p3::wasi::cli::stdout, + "wasi:cli/stderr@0.3.0": crate::p3::wasi::cli::stderr, + "wasi:cli/stdin@0.3.0": crate::p3::wasi::cli::stdin, + "wasi:cli/types@0.3.0": crate::p3::wasi::cli::types, + "wasi:clocks/monotonic-clock@0.3.0": crate::p3::wasi::clocks::monotonic_clock, + "wasi:clocks/system-clock@0.3.0": crate::p3::wasi::clocks::system_clock, + "wasi:clocks/types@0.3.0": crate::p3::wasi::clocks::types, }, }); } diff --git a/crates/wasi-http/src/p3/wit/deps/cli.wit b/crates/wasi-http/src/p3/wit/deps/cli.wit index 8ba52c5cd594..7aae56c17ed7 100644 --- a/crates/wasi-http/src/p3/wit/deps/cli.wit +++ b/crates/wasi-http/src/p3/wit/deps/cli.wit @@ -1,6 +1,6 @@ -package wasi:cli@0.3.0-rc-2026-03-15; +package wasi:cli@0.3.0; -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface environment { /// Get the POSIX-style environment variables. /// @@ -10,23 +10,23 @@ interface environment { /// Morally, these are a value import, but until value imports are available /// in the component model, this import function should return the same /// values each time it is called. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-environment: func() -> list>; /// Get the POSIX-style arguments to the program. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-arguments: func() -> list; /// Return a path that programs should use as their initial current working /// directory, interpreting `.` as shorthand for this. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-initial-cwd: func() -> option; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface exit { /// Exit the current instance and any linked instances. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) exit: func(status: result); /// Exit the current instance and any linked instances, reporting the @@ -37,20 +37,20 @@ interface exit { /// /// This function does not return; the effect is analogous to a trap, but /// without the connotation that something bad has happened. - @unstable(feature = cli-exit-with-code) + @since(version = 0.3.0) exit-with-code: func(status-code: u8); } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface run { /// Run the program. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) run: async func() -> result; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum error-code { /// Input/output error io, @@ -61,7 +61,7 @@ interface types { } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stdin { use types.{error-code}; @@ -78,11 +78,11 @@ interface stdin { /// /// Multiple streams may be active at the same time. The behavior of concurrent /// reads is implementation-specific. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-via-stream: func() -> tuple, future>>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stdout { use types.{error-code}; @@ -94,11 +94,11 @@ interface stdout { /// /// Otherwise if there is an error the readable end of the stream will be /// dropped and this function will return an error-code. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream) -> future>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stderr { use types.{error-code}; @@ -110,7 +110,7 @@ interface stderr { /// /// Otherwise if there is an error the readable end of the stream will be /// dropped and this function will return an error-code. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream) -> future>; } @@ -119,10 +119,10 @@ interface stderr { /// In the future, this may include functions for disabling echoing, /// disabling input buffering so that keyboard events are sent through /// immediately, querying supported features, and so on. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-input { /// The input side of a terminal. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource terminal-input; } @@ -131,126 +131,126 @@ interface terminal-input { /// In the future, this may include functions for querying the terminal /// size, being notified of terminal size changes, querying supported /// features, and so on. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-output { /// The output side of a terminal. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource terminal-output; } /// An interface providing an optional `terminal-input` for stdin as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stdin { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-input.{terminal-input}; /// If stdin is connected to a terminal, return a `terminal-input` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stdin: func() -> option; } /// An interface providing an optional `terminal-output` for stdout as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stdout { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-output.{terminal-output}; /// If stdout is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stdout: func() -> option; } /// An interface providing an optional `terminal-output` for stderr as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stderr { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-output.{terminal-output}; /// If stderr is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stderr: func() -> option; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import environment; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import exit; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stderr; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-input; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-output; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stderr; - import wasi:clocks/types@0.3.0-rc-2026-03-15; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/types@0.3.0; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:filesystem/types@0.3.0-rc-2026-03-15; - import wasi:filesystem/preopens@0.3.0-rc-2026-03-15; - import wasi:sockets/types@0.3.0-rc-2026-03-15; - import wasi:sockets/ip-name-lookup@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:filesystem/types@0.3.0; + import wasi:filesystem/preopens@0.3.0; + import wasi:sockets/types@0.3.0; + import wasi:sockets/ip-name-lookup@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world command { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import environment; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import exit; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stderr; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-input; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-output; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stderr; - import wasi:clocks/types@0.3.0-rc-2026-03-15; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/types@0.3.0; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:filesystem/types@0.3.0-rc-2026-03-15; - import wasi:filesystem/preopens@0.3.0-rc-2026-03-15; - import wasi:sockets/types@0.3.0-rc-2026-03-15; - import wasi:sockets/ip-name-lookup@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:filesystem/types@0.3.0; + import wasi:filesystem/preopens@0.3.0; + import wasi:sockets/types@0.3.0; + import wasi:sockets/ip-name-lookup@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) export run; } diff --git a/crates/wasi-http/src/p3/wit/deps/clocks.wit b/crates/wasi-http/src/p3/wit/deps/clocks.wit index 19fc4bcd59e9..d8b8cfe4e3a7 100644 --- a/crates/wasi-http/src/p3/wit/deps/clocks.wit +++ b/crates/wasi-http/src/p3/wit/deps/clocks.wit @@ -1,10 +1,10 @@ -package wasi:clocks@0.3.0-rc-2026-03-15; +package wasi:clocks@0.3.0; /// This interface common types used throughout wasi:clocks. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { /// A duration of time, in nanoseconds. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type duration = u64; } @@ -16,14 +16,14 @@ interface types { /// /// A monotonic clock is a clock which has an unspecified initial value, and /// successive reads of the clock will produce non-decreasing values. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface monotonic-clock { use types.{duration}; /// A mark on a monotonic clock is a number of nanoseconds since an /// unspecified initial value, and can only be compared to instances from /// the same monotonic-clock. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type mark = u64; /// Read the current value of the clock. @@ -35,20 +35,20 @@ interface monotonic-clock { /// the value of the clock in a `mark`. Consequently, implementations /// should ensure that the starting time is low enough to avoid the /// possibility of overflow in practice. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) now: func() -> mark; /// Query the resolution of the clock. Returns the duration of time /// corresponding to a clock tick. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-resolution: func() -> duration; /// Wait until the specified mark has occurred. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) wait-until: async func(when: mark); /// Wait for the specified duration to elapse. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) wait-for: async func(how-long: duration); } @@ -62,7 +62,7 @@ interface monotonic-clock { /// monotonic, making it unsuitable for measuring elapsed time. /// /// It is intended for reporting the current date and time for humans. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface system-clock { use types.{duration}; @@ -82,7 +82,7 @@ interface system-clock { /// /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record instant { seconds: s64, nanoseconds: u32, @@ -94,12 +94,12 @@ interface system-clock { /// will not necessarily produce a sequence of non-decreasing values. /// /// The nanoseconds field of the output is always less than 1000000000. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) now: func() -> instant; /// Query the resolution of the clock. Returns the smallest duration of time /// that the implementation permits distinguishing. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-resolution: func() -> duration; } @@ -148,13 +148,13 @@ interface timezone { to-debug-string: func() -> string; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import monotonic-clock; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import system-clock; @unstable(feature = clocks-timezone) import timezone; diff --git a/crates/wasi-http/src/p3/wit/deps/filesystem.wit b/crates/wasi-http/src/p3/wit/deps/filesystem.wit index 697681f30c5e..e4a778f3d237 100644 --- a/crates/wasi-http/src/p3/wit/deps/filesystem.wit +++ b/crates/wasi-http/src/p3/wit/deps/filesystem.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.3.0-rc-2026-03-15; +package wasi:filesystem@0.3.0; /// WASI filesystem is a filesystem API primarily intended to let users run WASI /// programs that access their files on their existing filesystems, without @@ -35,19 +35,19 @@ package wasi:filesystem@0.3.0-rc-2026-03-15; /// store or a database instead. /// /// [WASI filesystem path resolution]: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) - use wasi:clocks/system-clock@0.3.0-rc-2026-03-15.{instant}; + @since(version = 0.3.0) + use wasi:clocks/system-clock@0.3.0.{instant}; /// File size or length of a region within a file. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type filesize = u64; /// The type of a filesystem object referenced by a descriptor. /// /// Note: This was called `filetype` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant descriptor-type { /// The descriptor refers to a block device inode. block-device, @@ -71,7 +71,7 @@ interface types { /// Descriptor flags. /// /// Note: This was called `fdflags` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags descriptor-flags { /// Read mode: Data can be read. read, @@ -113,7 +113,7 @@ interface types { } /// Flags determining the method of how paths are resolved. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags path-flags { /// As long as the resolved path corresponds to a symbolic link, it is /// expanded. @@ -121,7 +121,7 @@ interface types { } /// Open flags used by `open-at`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags open-flags { /// Create file if it does not exist, similar to `O_CREAT` in POSIX. create, @@ -134,13 +134,13 @@ interface types { } /// Number of hard links to an inode. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type link-count = u64; /// File attributes. /// /// Note: This was called `filestat` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record descriptor-stat { /// File type. %type: descriptor-type, @@ -167,7 +167,7 @@ interface types { } /// When setting a timestamp, this gives the value to set it to. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant new-timestamp { /// Leave the timestamp set to its previous value. no-change, @@ -179,7 +179,7 @@ interface types { } /// A directory entry. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record directory-entry { /// The type of the file referred to by this directory entry. %type: descriptor-type, @@ -191,7 +191,7 @@ interface types { /// Not all of these error codes are returned by the functions provided by this /// API; some are used in higher-level library layers, and others are provided /// merely for alignment with POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Permission denied, similar to `EACCES` in POSIX. access, @@ -272,7 +272,7 @@ interface types { } /// File or memory access pattern advisory information. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum advice { /// The application has no advice to give on its behavior with respect /// to the specified data. @@ -296,7 +296,7 @@ interface types { /// A 128-bit hash value, split into parts because wasm doesn't have a /// 128-bit integer type. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record metadata-hash-value { /// 64 bits of a 128-bit hash value. lower: u64, @@ -307,7 +307,7 @@ interface types { /// A descriptor is a reference to a filesystem object, which may be a file, /// directory, named pipe, special file, or other object on which filesystem /// calls may be made. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource descriptor { /// Return a stream for reading from a file. /// @@ -325,7 +325,7 @@ interface types { /// resolves to `err` with an `error-code`. /// /// Note: This is similar to `pread` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-via-stream: func(offset: filesize) -> tuple, future>>; /// Return a stream for writing to a file, if available. /// @@ -339,7 +339,7 @@ interface types { /// written or an error is encountered. /// /// Note: This is similar to `pwrite` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream, offset: filesize) -> future>; /// Return a stream for appending to a file, if available. /// @@ -349,12 +349,12 @@ interface types { /// written or an error is encountered. /// /// Note: This is similar to `write` with `O_APPEND` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) append-via-stream: func(data: stream) -> future>; /// Provide file advisory information on a descriptor. /// /// This is similar to `posix_fadvise` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) advise: async func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code>; /// Synchronize the data of a file to disk. /// @@ -362,7 +362,7 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fdatasync` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) sync-data: async func() -> result<_, error-code>; /// Get flags associated with a descriptor. /// @@ -370,7 +370,7 @@ interface types { /// /// Note: This returns the value that was the `fs_flags` value returned /// from `fdstat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-flags: async func() -> result; /// Get the dynamic type of a descriptor. /// @@ -382,20 +382,20 @@ interface types { /// /// Note: This returns the value that was the `fs_filetype` value returned /// from `fdstat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-type: async func() -> result; /// Adjust the size of an open file. If this increases the file's size, the /// extra bytes are filled with zeros. /// /// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-size: async func(size: filesize) -> result<_, error-code>; /// Adjust the timestamps of an open file or directory. /// /// Note: This is similar to `futimens` in POSIX. /// /// Note: This was called `fd_filestat_set_times` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-times: async func(data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; /// Read directory entries from a directory. /// @@ -409,7 +409,7 @@ interface types { /// /// This function returns a future, which will resolve to an error code if /// reading full contents of the directory fails. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-directory: func() -> tuple, future>>; /// Synchronize the data and metadata of a file to disk. /// @@ -417,12 +417,12 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fsync` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) sync: async func() -> result<_, error-code>; /// Create a directory. /// /// Note: This is similar to `mkdirat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create-directory-at: async func(path: string) -> result<_, error-code>; /// Return the attributes of an open file or directory. /// @@ -433,7 +433,7 @@ interface types { /// modified, use `metadata-hash`. /// /// Note: This was called `fd_filestat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) stat: async func() -> result; /// Return the attributes of a file or directory. /// @@ -442,7 +442,7 @@ interface types { /// discussion of alternatives. /// /// Note: This was called `path_filestat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) stat-at: async func(path-flags: path-flags, path: string) -> result; /// Adjust the timestamps of a file or directory. /// @@ -450,7 +450,7 @@ interface types { /// /// Note: This was called `path_filestat_set_times` in earlier versions of /// WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-times-at: async func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; /// Create a hard link. /// @@ -459,7 +459,7 @@ interface types { /// `error-code::not-permitted` if the old path is not a file. /// /// Note: This is similar to `linkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) link-at: async func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; /// Open a file or directory. /// @@ -473,7 +473,7 @@ interface types { /// `error-code::read-only`. /// /// Note: This is similar to `openat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) open-at: async func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: descriptor-flags) -> result; /// Read the contents of a symbolic link. /// @@ -481,19 +481,19 @@ interface types { /// filesystem, this function fails with `error-code::not-permitted`. /// /// Note: This is similar to `readlinkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) readlink-at: async func(path: string) -> result; /// Remove a directory. /// /// Return `error-code::not-empty` if the directory is not empty. /// /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) remove-directory-at: async func(path: string) -> result<_, error-code>; /// Rename a filesystem object. /// /// Note: This is similar to `renameat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) rename-at: async func(old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; /// Create a symbolic link (also known as a "symlink"). /// @@ -501,7 +501,7 @@ interface types { /// `error-code::not-permitted`. /// /// Note: This is similar to `symlinkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) symlink-at: async func(old-path: string, new-path: string) -> result<_, error-code>; /// Unlink a filesystem object that is not a directory. /// @@ -512,7 +512,7 @@ interface types { /// If the filesystem object is a directory, `error-code::access` or /// `error-code::is-directory` may be returned instead of the /// POSIX-specified `error-code::not-permitted`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) unlink-file-at: async func(path: string) -> result<_, error-code>; /// Test whether two descriptors refer to the same filesystem object. /// @@ -520,7 +520,7 @@ interface types { /// same device (`st_dev`) and inode (`st_ino` or `d_ino`) numbers. /// wasi-filesystem does not expose device and inode numbers, so this function /// may be used instead. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) is-same-object: async func(other: borrow) -> bool; /// Return a hash of the metadata associated with a filesystem object referred /// to by a descriptor. @@ -541,35 +541,35 @@ interface types { /// computed hash. /// /// However, none of these is required. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) metadata-hash: async func() -> result; /// Return a hash of the metadata associated with a filesystem object referred /// to by a directory descriptor and a relative path. /// /// This performs the same hash computation as `metadata-hash`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) metadata-hash-at: async func(path-flags: path-flags, path: string) -> result; } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface preopens { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use types.{descriptor}; /// Return the set of preopened directories, and their paths. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-directories: func() -> list>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/types@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) + import wasi:clocks/types@0.3.0; + @since(version = 0.3.0) + import wasi:clocks/system-clock@0.3.0; + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import preopens; } diff --git a/crates/wasi-http/src/p3/wit/deps/http.wit b/crates/wasi-http/src/p3/wit/deps/http.wit index c1c1e68e75ba..08458f7c6848 100644 --- a/crates/wasi-http/src/p3/wit/deps/http.wit +++ b/crates/wasi-http/src/p3/wit/deps/http.wit @@ -1,13 +1,13 @@ -package wasi:http@0.3.0-rc-2026-03-15; +package wasi:http@0.3.0; /// This interface defines all of the types and methods for implementing HTTP /// Requests and Responses, as well as their headers, trailers, and bodies. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - use wasi:clocks/types@0.3.0-rc-2026-03-15.{duration}; + use wasi:clocks/types@0.3.0.{duration}; /// This type corresponds to HTTP standard Methods. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant method { get, head, @@ -22,7 +22,7 @@ interface types { } /// This type corresponds to HTTP standard Related Schemes. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant scheme { HTTP, HTTPS, @@ -30,21 +30,21 @@ interface types { } /// Defines the case payload type for `DNS-error` above: - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record DNS-error-payload { rcode: option, info-code: option, } /// Defines the case payload type for `TLS-alert-received` above: - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record TLS-alert-received-payload { alert-id: option, alert-message: option, } /// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record field-size-payload { field-name: option, field-size: option, @@ -52,7 +52,7 @@ interface types { /// These cases are inspired by the IANA HTTP Proxy Error Types: /// - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { DNS-timeout, DNS-error(DNS-error-payload), @@ -102,7 +102,7 @@ interface types { /// This type enumerates the different kinds of errors that may occur when /// setting or appending to a `fields` resource. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant header-error { /// This error indicates that a `field-name` or `field-value` was /// syntactically invalid when used with an operation that sets headers in a @@ -130,7 +130,7 @@ interface types { /// This type enumerates the different kinds of errors that may occur when /// setting fields of a `request-options` resource. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant request-options-error { /// Indicates the specified field is not supported by this implementation. not-supported, @@ -150,13 +150,13 @@ interface types { /// /// Field names should always be treated as case insensitive by the `fields` /// resource for the purposes of equality checking. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type field-name = string; /// Field values should always be ASCII strings. However, in /// reality, HTTP implementations often have to interpret malformed values, /// so they are provided as a list of bytes. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type field-value = list; /// This following block defines the `fields` resource which corresponds to @@ -178,7 +178,7 @@ interface types { /// Implementations may impose limits on individual field values and on total /// aggregate field section size. Operations that would exceed these limits /// fail with `header-error.size-exceeded` - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource fields { /// Construct an empty HTTP Fields. /// @@ -254,15 +254,15 @@ interface types { } /// Headers is an alias for Fields. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type headers = fields; /// Trailers is an alias for Fields. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type trailers = fields; /// Represents an HTTP Request. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource request { /// Construct a new `request` with a default `method` of `GET`, and /// `none` values for `path-with-query`, `scheme`, and `authority`. @@ -349,7 +349,7 @@ interface types { /// /// These timeouts are separate from any the user may use to bound an /// asynchronous call. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource request-options { /// Construct a default `request-options` value. constructor(); @@ -378,11 +378,11 @@ interface types { } /// This type corresponds to the HTTP standard Status Code. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type status-code = u16; /// Represents an HTTP Response. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource response { /// Construct a new `response`, with a default `status-code` of `200`. /// If a different `status-code` is needed, it must be set via the @@ -431,7 +431,7 @@ interface types { /// /// In `wasi:http/middleware` this interface is both exported and imported as /// the "downstream" and "upstream" directions of the middleware chain. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface handler { use types.{request, response, error-code}; @@ -450,7 +450,7 @@ interface handler { /// (including WIT itself) is unable to represent a component importing two /// instances of the same interface. A `client.send` import may be linked /// directly to a `handler.handle` export to bypass the network. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface client { use types.{request, response, error-code}; @@ -462,22 +462,22 @@ interface client { /// The `wasi:http/service` world captures a broad category of HTTP services /// including web applications, API servers, and proxies. It may be `include`d /// in more specific worlds such as `wasi:http/middleware`. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world service { - import wasi:cli/types@0.3.0-rc-2026-03-15; - import wasi:cli/stdout@0.3.0-rc-2026-03-15; - import wasi:cli/stderr@0.3.0-rc-2026-03-15; - import wasi:cli/stdin@0.3.0-rc-2026-03-15; - import wasi:clocks/types@0.3.0-rc-2026-03-15; + import wasi:cli/types@0.3.0; + import wasi:cli/stdout@0.3.0; + import wasi:cli/stderr@0.3.0; + import wasi:cli/stdin@0.3.0; + import wasi:clocks/types@0.3.0; import types; import client; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; export handler; } @@ -487,23 +487,23 @@ world service { /// Components may implement this world to allow them to participate in handler /// "chains" where a `request` flows through handlers on its way to some terminal /// `service` and corresponding `response` flows in the opposite direction. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world middleware { - import wasi:clocks/types@0.3.0-rc-2026-03-15; + import wasi:clocks/types@0.3.0; import types; import handler; - import wasi:cli/types@0.3.0-rc-2026-03-15; - import wasi:cli/stdout@0.3.0-rc-2026-03-15; - import wasi:cli/stderr@0.3.0-rc-2026-03-15; - import wasi:cli/stdin@0.3.0-rc-2026-03-15; + import wasi:cli/types@0.3.0; + import wasi:cli/stdout@0.3.0; + import wasi:cli/stderr@0.3.0; + import wasi:cli/stdin@0.3.0; import client; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; export handler; } diff --git a/crates/wasi-http/src/p3/wit/deps/random.wit b/crates/wasi-http/src/p3/wit/deps/random.wit index 026f44a10949..0b9a55fc09a6 100644 --- a/crates/wasi-http/src/p3/wit/deps/random.wit +++ b/crates/wasi-http/src/p3/wit/deps/random.wit @@ -1,10 +1,10 @@ -package wasi:random@0.3.0-rc-2026-03-15; +package wasi:random@0.3.0; /// The insecure-seed interface for seeding hash-map DoS resistance. /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface insecure-seed { /// Return a 128-bit value that may contain a pseudo-random value. /// @@ -23,7 +23,7 @@ interface insecure-seed { /// This will likely be changed to a value import, to prevent it from being /// called multiple times and potentially used for purposes other than DoS /// protection. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-seed: func() -> tuple; } @@ -31,7 +31,7 @@ interface insecure-seed { /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface insecure { /// Return up to `max-len` insecure pseudo-random bytes. /// @@ -48,14 +48,14 @@ interface insecure { /// Implementations MUST return at least 1 byte when `max-len` is greater /// than zero. When `max-len` is zero, implementations MUST return an empty /// list without trapping. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-random-bytes: func(max-len: u64) -> list; /// Return an insecure pseudo-random `u64` value. /// /// This function returns the same type of pseudo-random data as /// `get-insecure-random-bytes`, represented as a `u64`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-random-u64: func() -> u64; } @@ -63,7 +63,7 @@ interface insecure { /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface random { /// Return up to `max-len` cryptographically-secure random or pseudo-random /// bytes. @@ -85,23 +85,23 @@ interface random { /// This function must always return fresh data. Deterministic environments /// must omit this function, rather than implementing it with deterministic /// data. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-random-bytes: func(max-len: u64) -> list; /// Return a cryptographically-secure random or pseudo-random `u64` value. /// /// This function returns the same type of data as `get-random-bytes`, /// represented as a `u64`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-random-u64: func() -> u64; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import random; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import insecure; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import insecure-seed; } diff --git a/crates/wasi-http/src/p3/wit/deps/sockets.wit b/crates/wasi-http/src/p3/wit/deps/sockets.wit index cde2e4d6ebe0..0dd27a4fc4b2 100644 --- a/crates/wasi-http/src/p3/wit/deps/sockets.wit +++ b/crates/wasi-http/src/p3/wit/deps/sockets.wit @@ -1,9 +1,9 @@ -package wasi:sockets@0.3.0-rc-2026-03-15; +package wasi:sockets@0.3.0; -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) - use wasi:clocks/types@0.3.0-rc-2026-03-15.{duration}; + @since(version = 0.3.0) + use wasi:clocks/types@0.3.0.{duration}; /// Error codes. /// @@ -16,7 +16,7 @@ interface types { /// - `out-of-memory` /// /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Access denied. /// @@ -80,7 +80,7 @@ interface types { other(option), } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum ip-address-family { /// Similar to `AF_INET` in POSIX. ipv4, @@ -88,19 +88,19 @@ interface types { ipv6, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type ipv4-address = tuple; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type ipv6-address = tuple; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant ip-address { ipv4(ipv4-address), ipv6(ipv6-address), } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record ipv4-socket-address { /// sin_port port: u16, @@ -108,7 +108,7 @@ interface types { address: ipv4-address, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record ipv6-socket-address { /// sin6_port port: u16, @@ -120,7 +120,7 @@ interface types { scope-id: u32, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant ip-socket-address { ipv4(ipv4-socket-address), ipv6(ipv6-socket-address), @@ -135,7 +135,7 @@ interface types { /// - `connecting` /// - `connected` /// - `closed` - /// See + /// See /// for more information. /// /// Note: Except where explicitly mentioned, whenever this documentation uses @@ -158,7 +158,7 @@ interface types { /// In addition to the general error codes documented on the /// `types::error-code` type, TCP socket methods may always return /// `error(invalid-state)` when in the `closed` state. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource tcp-socket { /// Create a new TCP socket. /// @@ -178,7 +178,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create: static func(address-family: ip-address-family) -> result; /// Bind the socket to the provided IP address and port. /// @@ -213,7 +213,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) bind: func(local-address: ip-socket-address) -> result<_, error-code>; /// Connect to a remote endpoint. /// @@ -249,7 +249,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) connect: async func(remote-address: ip-socket-address) -> result<_, error-code>; /// Start listening and return a stream of new inbound connections. /// @@ -321,7 +321,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) listen: func() -> result, error-code>; /// Transmit data to peer. /// @@ -345,7 +345,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) send: func(data: stream) -> future>; /// Read data from peer. /// @@ -374,7 +374,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) receive: func() -> tuple, future>>; /// Get the bound local address. /// @@ -393,7 +393,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-local-address: func() -> result; /// Get the remote address. /// @@ -405,19 +405,19 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-remote-address: func() -> result; /// Whether the socket is in the `listening` state. /// /// Equivalent to the SO_ACCEPTCONN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-is-listening: func() -> bool; /// Whether this is a IPv4 or IPv6 socket. /// /// This is the value passed to the constructor. /// /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-address-family: func() -> ip-address-family; /// Hints the desired listen queue size. Implementations are free to /// ignore this. @@ -430,7 +430,7 @@ interface types { /// - `not-supported`: (set) The platform does not support changing the backlog size after the initial listen. /// - `invalid-argument`: (set) The provided value was 0. /// - `invalid-state`: (set) The socket is in the `connecting` or `connected` state. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-listen-backlog-size: func(value: u64) -> result<_, error-code>; /// Enables or disables keepalive. /// @@ -442,9 +442,9 @@ interface types { /// false, but only come into effect when `keep-alive-enabled` is true. /// /// Equivalent to the SO_KEEPALIVE socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-enabled: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; /// Amount of time the connection has to be idle before TCP starts /// sending keepalive packets. @@ -458,9 +458,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-idle-time: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; /// The time between keepalive packets. /// @@ -473,9 +473,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-interval: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-interval: func(value: duration) -> result<_, error-code>; /// The maximum amount of keepalive packets TCP should send before /// aborting the connection. @@ -489,9 +489,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-count: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-count: func(value: u32) -> result<_, error-code>; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. /// @@ -499,9 +499,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-hop-limit: func(value: u8) -> result<_, error-code>; /// Kernel buffer space reserved for sending/receiving on this socket. /// Implementations usually treat this as a cap the buffer can grow to, @@ -524,18 +524,18 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } /// A UDP socket handle. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource udp-socket { /// Create a new UDP socket. /// @@ -552,7 +552,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create: static func(address-family: ip-address-family) -> result; /// Bind the socket to the provided IP address and port. /// @@ -573,7 +573,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) bind: func(local-address: ip-socket-address) -> result<_, error-code>; /// Associate this socket with a specific peer address. /// @@ -611,7 +611,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) connect: func(remote-address: ip-socket-address) -> result<_, error-code>; /// Dissociate this socket from its peer address. /// @@ -628,7 +628,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) disconnect: func() -> result<_, error-code>; /// Send a message on the socket to a particular peer. /// @@ -672,7 +672,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) send: async func(data: list, remote-address: option) -> result<_, error-code>; /// Receive a message on the socket. /// @@ -697,7 +697,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) receive: async func() -> result, ip-socket-address>, error-code>; /// Get the current bound address. /// @@ -716,7 +716,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-local-address: func() -> result; /// Get the address the socket is currently "connected" to. /// @@ -728,14 +728,14 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-remote-address: func() -> result; /// Whether this is a IPv4 or IPv6 socket. /// /// This is the value passed to the constructor. /// /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-address-family: func() -> ip-address-family; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. /// @@ -743,9 +743,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-unicast-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; /// Kernel buffer space reserved for sending/receiving on this socket. /// Implementations usually treat this as a cap the buffer can grow to, @@ -760,24 +760,24 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface ip-name-lookup { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use types.{ip-address}; /// Lookup error codes. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Access denied. /// @@ -824,16 +824,16 @@ interface ip-name-lookup { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resolve-addresses: async func(name: string) -> result, error-code>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/types@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) + import wasi:clocks/types@0.3.0; + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import ip-name-lookup; } diff --git a/crates/wasi-http/src/p3/wit/world.wit b/crates/wasi-http/src/p3/wit/world.wit index 8e7c32424586..8f5009396914 100644 --- a/crates/wasi-http/src/p3/wit/world.wit +++ b/crates/wasi-http/src/p3/wit/world.wit @@ -2,5 +2,5 @@ package wasmtime:wasi-http; world bindings { - include wasi:http/service@0.3.0-rc-2026-03-15; + include wasi:http/service@0.3.0; } diff --git a/crates/wasi-http/tests/all/p3/mod.rs b/crates/wasi-http/tests/all/p3/mod.rs index af3fdb0b9fcd..532cbfd80dd6 100644 --- a/crates/wasi-http/tests/all/p3/mod.rs +++ b/crates/wasi-http/tests/all/p3/mod.rs @@ -405,7 +405,7 @@ async fn test_http_middleware_with_chain(host_to_host: bool) -> Result<()> { "local:local/chain-http".to_owned(), InstantiationArg { instance: "local:local/chain-http".into(), - export: Some("wasi:http/handler@0.3.0-rc-2026-03-15".into()), + export: Some("wasi:http/handler@0.3.0".into()), }, )] .into_iter() diff --git a/crates/wasi/src/p3/bindings.rs b/crates/wasi/src/p3/bindings.rs index d6c11da7703e..ab774e909f53 100644 --- a/crates/wasi/src/p3/bindings.rs +++ b/crates/wasi/src/p3/bindings.rs @@ -23,7 +23,7 @@ //! // An example of extending the `wasi:cli/command` world with a //! // custom host interface. //! world my-world { -//! include wasi:cli/command@0.3.0-rc-2026-03-15; +//! include wasi:cli/command@0.3.0; //! //! import custom-host; //! } diff --git a/crates/wasi/src/p3/cli/mod.rs b/crates/wasi/src/p3/cli/mod.rs index 5e96b919ddae..630bc748eaa7 100644 --- a/crates/wasi/src/p3/cli/mod.rs +++ b/crates/wasi/src/p3/cli/mod.rs @@ -62,19 +62,7 @@ pub fn add_to_linker(linker: &mut Linker) -> wasmtime::Result<()> where T: WasiCliView + 'static, { - let exit_options = exit::LinkOptions::default(); - add_to_linker_with_options(linker, &exit_options) -} - -/// Similar to [`add_to_linker`], but with the ability to enable unstable features. -pub fn add_to_linker_with_options( - linker: &mut Linker, - exit_options: &exit::LinkOptions, -) -> wasmtime::Result<()> -where - T: WasiCliView + 'static, -{ - exit::add_to_linker::<_, WasiCli>(linker, exit_options, T::cli)?; + exit::add_to_linker::<_, WasiCli>(linker, T::cli)?; environment::add_to_linker::<_, WasiCli>(linker, T::cli)?; stdin::add_to_linker::<_, WasiCli>(linker, T::cli)?; stdout::add_to_linker::<_, WasiCli>(linker, T::cli)?; diff --git a/crates/wasi/src/p3/mod.rs b/crates/wasi/src/p3/mod.rs index ecbb31a6e0cc..96df64a06724 100644 --- a/crates/wasi/src/p3/mod.rs +++ b/crates/wasi/src/p3/mod.rs @@ -178,12 +178,12 @@ where /// Similar to [`add_to_linker`], but with the ability to enable unstable features. pub fn add_to_linker_with_options( linker: &mut Linker, - options: &LinkOptions, + _options: &LinkOptions, ) -> wasmtime::Result<()> where T: WasiView + 'static, { - cli::add_to_linker_with_options(linker, &options.into())?; + cli::add_to_linker(linker)?; clocks::add_to_linker(linker)?; filesystem::add_to_linker(linker)?; random::add_to_linker(linker)?; diff --git a/crates/wasi/src/p3/wit/deps/cli.wit b/crates/wasi/src/p3/wit/deps/cli.wit index 8ba52c5cd594..7aae56c17ed7 100644 --- a/crates/wasi/src/p3/wit/deps/cli.wit +++ b/crates/wasi/src/p3/wit/deps/cli.wit @@ -1,6 +1,6 @@ -package wasi:cli@0.3.0-rc-2026-03-15; +package wasi:cli@0.3.0; -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface environment { /// Get the POSIX-style environment variables. /// @@ -10,23 +10,23 @@ interface environment { /// Morally, these are a value import, but until value imports are available /// in the component model, this import function should return the same /// values each time it is called. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-environment: func() -> list>; /// Get the POSIX-style arguments to the program. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-arguments: func() -> list; /// Return a path that programs should use as their initial current working /// directory, interpreting `.` as shorthand for this. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-initial-cwd: func() -> option; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface exit { /// Exit the current instance and any linked instances. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) exit: func(status: result); /// Exit the current instance and any linked instances, reporting the @@ -37,20 +37,20 @@ interface exit { /// /// This function does not return; the effect is analogous to a trap, but /// without the connotation that something bad has happened. - @unstable(feature = cli-exit-with-code) + @since(version = 0.3.0) exit-with-code: func(status-code: u8); } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface run { /// Run the program. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) run: async func() -> result; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum error-code { /// Input/output error io, @@ -61,7 +61,7 @@ interface types { } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stdin { use types.{error-code}; @@ -78,11 +78,11 @@ interface stdin { /// /// Multiple streams may be active at the same time. The behavior of concurrent /// reads is implementation-specific. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-via-stream: func() -> tuple, future>>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stdout { use types.{error-code}; @@ -94,11 +94,11 @@ interface stdout { /// /// Otherwise if there is an error the readable end of the stream will be /// dropped and this function will return an error-code. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream) -> future>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stderr { use types.{error-code}; @@ -110,7 +110,7 @@ interface stderr { /// /// Otherwise if there is an error the readable end of the stream will be /// dropped and this function will return an error-code. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream) -> future>; } @@ -119,10 +119,10 @@ interface stderr { /// In the future, this may include functions for disabling echoing, /// disabling input buffering so that keyboard events are sent through /// immediately, querying supported features, and so on. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-input { /// The input side of a terminal. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource terminal-input; } @@ -131,126 +131,126 @@ interface terminal-input { /// In the future, this may include functions for querying the terminal /// size, being notified of terminal size changes, querying supported /// features, and so on. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-output { /// The output side of a terminal. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource terminal-output; } /// An interface providing an optional `terminal-input` for stdin as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stdin { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-input.{terminal-input}; /// If stdin is connected to a terminal, return a `terminal-input` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stdin: func() -> option; } /// An interface providing an optional `terminal-output` for stdout as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stdout { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-output.{terminal-output}; /// If stdout is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stdout: func() -> option; } /// An interface providing an optional `terminal-output` for stderr as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stderr { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-output.{terminal-output}; /// If stderr is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stderr: func() -> option; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import environment; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import exit; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stderr; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-input; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-output; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stderr; - import wasi:clocks/types@0.3.0-rc-2026-03-15; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/types@0.3.0; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:filesystem/types@0.3.0-rc-2026-03-15; - import wasi:filesystem/preopens@0.3.0-rc-2026-03-15; - import wasi:sockets/types@0.3.0-rc-2026-03-15; - import wasi:sockets/ip-name-lookup@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:filesystem/types@0.3.0; + import wasi:filesystem/preopens@0.3.0; + import wasi:sockets/types@0.3.0; + import wasi:sockets/ip-name-lookup@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world command { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import environment; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import exit; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stderr; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-input; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-output; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stderr; - import wasi:clocks/types@0.3.0-rc-2026-03-15; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/types@0.3.0; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:filesystem/types@0.3.0-rc-2026-03-15; - import wasi:filesystem/preopens@0.3.0-rc-2026-03-15; - import wasi:sockets/types@0.3.0-rc-2026-03-15; - import wasi:sockets/ip-name-lookup@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:filesystem/types@0.3.0; + import wasi:filesystem/preopens@0.3.0; + import wasi:sockets/types@0.3.0; + import wasi:sockets/ip-name-lookup@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) export run; } diff --git a/crates/wasi/src/p3/wit/deps/clocks.wit b/crates/wasi/src/p3/wit/deps/clocks.wit index 19fc4bcd59e9..d8b8cfe4e3a7 100644 --- a/crates/wasi/src/p3/wit/deps/clocks.wit +++ b/crates/wasi/src/p3/wit/deps/clocks.wit @@ -1,10 +1,10 @@ -package wasi:clocks@0.3.0-rc-2026-03-15; +package wasi:clocks@0.3.0; /// This interface common types used throughout wasi:clocks. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { /// A duration of time, in nanoseconds. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type duration = u64; } @@ -16,14 +16,14 @@ interface types { /// /// A monotonic clock is a clock which has an unspecified initial value, and /// successive reads of the clock will produce non-decreasing values. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface monotonic-clock { use types.{duration}; /// A mark on a monotonic clock is a number of nanoseconds since an /// unspecified initial value, and can only be compared to instances from /// the same monotonic-clock. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type mark = u64; /// Read the current value of the clock. @@ -35,20 +35,20 @@ interface monotonic-clock { /// the value of the clock in a `mark`. Consequently, implementations /// should ensure that the starting time is low enough to avoid the /// possibility of overflow in practice. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) now: func() -> mark; /// Query the resolution of the clock. Returns the duration of time /// corresponding to a clock tick. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-resolution: func() -> duration; /// Wait until the specified mark has occurred. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) wait-until: async func(when: mark); /// Wait for the specified duration to elapse. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) wait-for: async func(how-long: duration); } @@ -62,7 +62,7 @@ interface monotonic-clock { /// monotonic, making it unsuitable for measuring elapsed time. /// /// It is intended for reporting the current date and time for humans. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface system-clock { use types.{duration}; @@ -82,7 +82,7 @@ interface system-clock { /// /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record instant { seconds: s64, nanoseconds: u32, @@ -94,12 +94,12 @@ interface system-clock { /// will not necessarily produce a sequence of non-decreasing values. /// /// The nanoseconds field of the output is always less than 1000000000. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) now: func() -> instant; /// Query the resolution of the clock. Returns the smallest duration of time /// that the implementation permits distinguishing. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-resolution: func() -> duration; } @@ -148,13 +148,13 @@ interface timezone { to-debug-string: func() -> string; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import monotonic-clock; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import system-clock; @unstable(feature = clocks-timezone) import timezone; diff --git a/crates/wasi/src/p3/wit/deps/filesystem.wit b/crates/wasi/src/p3/wit/deps/filesystem.wit index 697681f30c5e..e4a778f3d237 100644 --- a/crates/wasi/src/p3/wit/deps/filesystem.wit +++ b/crates/wasi/src/p3/wit/deps/filesystem.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.3.0-rc-2026-03-15; +package wasi:filesystem@0.3.0; /// WASI filesystem is a filesystem API primarily intended to let users run WASI /// programs that access their files on their existing filesystems, without @@ -35,19 +35,19 @@ package wasi:filesystem@0.3.0-rc-2026-03-15; /// store or a database instead. /// /// [WASI filesystem path resolution]: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) - use wasi:clocks/system-clock@0.3.0-rc-2026-03-15.{instant}; + @since(version = 0.3.0) + use wasi:clocks/system-clock@0.3.0.{instant}; /// File size or length of a region within a file. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type filesize = u64; /// The type of a filesystem object referenced by a descriptor. /// /// Note: This was called `filetype` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant descriptor-type { /// The descriptor refers to a block device inode. block-device, @@ -71,7 +71,7 @@ interface types { /// Descriptor flags. /// /// Note: This was called `fdflags` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags descriptor-flags { /// Read mode: Data can be read. read, @@ -113,7 +113,7 @@ interface types { } /// Flags determining the method of how paths are resolved. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags path-flags { /// As long as the resolved path corresponds to a symbolic link, it is /// expanded. @@ -121,7 +121,7 @@ interface types { } /// Open flags used by `open-at`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags open-flags { /// Create file if it does not exist, similar to `O_CREAT` in POSIX. create, @@ -134,13 +134,13 @@ interface types { } /// Number of hard links to an inode. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type link-count = u64; /// File attributes. /// /// Note: This was called `filestat` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record descriptor-stat { /// File type. %type: descriptor-type, @@ -167,7 +167,7 @@ interface types { } /// When setting a timestamp, this gives the value to set it to. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant new-timestamp { /// Leave the timestamp set to its previous value. no-change, @@ -179,7 +179,7 @@ interface types { } /// A directory entry. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record directory-entry { /// The type of the file referred to by this directory entry. %type: descriptor-type, @@ -191,7 +191,7 @@ interface types { /// Not all of these error codes are returned by the functions provided by this /// API; some are used in higher-level library layers, and others are provided /// merely for alignment with POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Permission denied, similar to `EACCES` in POSIX. access, @@ -272,7 +272,7 @@ interface types { } /// File or memory access pattern advisory information. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum advice { /// The application has no advice to give on its behavior with respect /// to the specified data. @@ -296,7 +296,7 @@ interface types { /// A 128-bit hash value, split into parts because wasm doesn't have a /// 128-bit integer type. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record metadata-hash-value { /// 64 bits of a 128-bit hash value. lower: u64, @@ -307,7 +307,7 @@ interface types { /// A descriptor is a reference to a filesystem object, which may be a file, /// directory, named pipe, special file, or other object on which filesystem /// calls may be made. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource descriptor { /// Return a stream for reading from a file. /// @@ -325,7 +325,7 @@ interface types { /// resolves to `err` with an `error-code`. /// /// Note: This is similar to `pread` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-via-stream: func(offset: filesize) -> tuple, future>>; /// Return a stream for writing to a file, if available. /// @@ -339,7 +339,7 @@ interface types { /// written or an error is encountered. /// /// Note: This is similar to `pwrite` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream, offset: filesize) -> future>; /// Return a stream for appending to a file, if available. /// @@ -349,12 +349,12 @@ interface types { /// written or an error is encountered. /// /// Note: This is similar to `write` with `O_APPEND` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) append-via-stream: func(data: stream) -> future>; /// Provide file advisory information on a descriptor. /// /// This is similar to `posix_fadvise` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) advise: async func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code>; /// Synchronize the data of a file to disk. /// @@ -362,7 +362,7 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fdatasync` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) sync-data: async func() -> result<_, error-code>; /// Get flags associated with a descriptor. /// @@ -370,7 +370,7 @@ interface types { /// /// Note: This returns the value that was the `fs_flags` value returned /// from `fdstat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-flags: async func() -> result; /// Get the dynamic type of a descriptor. /// @@ -382,20 +382,20 @@ interface types { /// /// Note: This returns the value that was the `fs_filetype` value returned /// from `fdstat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-type: async func() -> result; /// Adjust the size of an open file. If this increases the file's size, the /// extra bytes are filled with zeros. /// /// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-size: async func(size: filesize) -> result<_, error-code>; /// Adjust the timestamps of an open file or directory. /// /// Note: This is similar to `futimens` in POSIX. /// /// Note: This was called `fd_filestat_set_times` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-times: async func(data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; /// Read directory entries from a directory. /// @@ -409,7 +409,7 @@ interface types { /// /// This function returns a future, which will resolve to an error code if /// reading full contents of the directory fails. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-directory: func() -> tuple, future>>; /// Synchronize the data and metadata of a file to disk. /// @@ -417,12 +417,12 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fsync` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) sync: async func() -> result<_, error-code>; /// Create a directory. /// /// Note: This is similar to `mkdirat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create-directory-at: async func(path: string) -> result<_, error-code>; /// Return the attributes of an open file or directory. /// @@ -433,7 +433,7 @@ interface types { /// modified, use `metadata-hash`. /// /// Note: This was called `fd_filestat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) stat: async func() -> result; /// Return the attributes of a file or directory. /// @@ -442,7 +442,7 @@ interface types { /// discussion of alternatives. /// /// Note: This was called `path_filestat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) stat-at: async func(path-flags: path-flags, path: string) -> result; /// Adjust the timestamps of a file or directory. /// @@ -450,7 +450,7 @@ interface types { /// /// Note: This was called `path_filestat_set_times` in earlier versions of /// WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-times-at: async func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; /// Create a hard link. /// @@ -459,7 +459,7 @@ interface types { /// `error-code::not-permitted` if the old path is not a file. /// /// Note: This is similar to `linkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) link-at: async func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; /// Open a file or directory. /// @@ -473,7 +473,7 @@ interface types { /// `error-code::read-only`. /// /// Note: This is similar to `openat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) open-at: async func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: descriptor-flags) -> result; /// Read the contents of a symbolic link. /// @@ -481,19 +481,19 @@ interface types { /// filesystem, this function fails with `error-code::not-permitted`. /// /// Note: This is similar to `readlinkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) readlink-at: async func(path: string) -> result; /// Remove a directory. /// /// Return `error-code::not-empty` if the directory is not empty. /// /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) remove-directory-at: async func(path: string) -> result<_, error-code>; /// Rename a filesystem object. /// /// Note: This is similar to `renameat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) rename-at: async func(old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; /// Create a symbolic link (also known as a "symlink"). /// @@ -501,7 +501,7 @@ interface types { /// `error-code::not-permitted`. /// /// Note: This is similar to `symlinkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) symlink-at: async func(old-path: string, new-path: string) -> result<_, error-code>; /// Unlink a filesystem object that is not a directory. /// @@ -512,7 +512,7 @@ interface types { /// If the filesystem object is a directory, `error-code::access` or /// `error-code::is-directory` may be returned instead of the /// POSIX-specified `error-code::not-permitted`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) unlink-file-at: async func(path: string) -> result<_, error-code>; /// Test whether two descriptors refer to the same filesystem object. /// @@ -520,7 +520,7 @@ interface types { /// same device (`st_dev`) and inode (`st_ino` or `d_ino`) numbers. /// wasi-filesystem does not expose device and inode numbers, so this function /// may be used instead. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) is-same-object: async func(other: borrow) -> bool; /// Return a hash of the metadata associated with a filesystem object referred /// to by a descriptor. @@ -541,35 +541,35 @@ interface types { /// computed hash. /// /// However, none of these is required. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) metadata-hash: async func() -> result; /// Return a hash of the metadata associated with a filesystem object referred /// to by a directory descriptor and a relative path. /// /// This performs the same hash computation as `metadata-hash`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) metadata-hash-at: async func(path-flags: path-flags, path: string) -> result; } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface preopens { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use types.{descriptor}; /// Return the set of preopened directories, and their paths. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-directories: func() -> list>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/types@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) + import wasi:clocks/types@0.3.0; + @since(version = 0.3.0) + import wasi:clocks/system-clock@0.3.0; + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import preopens; } diff --git a/crates/wasi/src/p3/wit/deps/random.wit b/crates/wasi/src/p3/wit/deps/random.wit index 026f44a10949..0b9a55fc09a6 100644 --- a/crates/wasi/src/p3/wit/deps/random.wit +++ b/crates/wasi/src/p3/wit/deps/random.wit @@ -1,10 +1,10 @@ -package wasi:random@0.3.0-rc-2026-03-15; +package wasi:random@0.3.0; /// The insecure-seed interface for seeding hash-map DoS resistance. /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface insecure-seed { /// Return a 128-bit value that may contain a pseudo-random value. /// @@ -23,7 +23,7 @@ interface insecure-seed { /// This will likely be changed to a value import, to prevent it from being /// called multiple times and potentially used for purposes other than DoS /// protection. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-seed: func() -> tuple; } @@ -31,7 +31,7 @@ interface insecure-seed { /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface insecure { /// Return up to `max-len` insecure pseudo-random bytes. /// @@ -48,14 +48,14 @@ interface insecure { /// Implementations MUST return at least 1 byte when `max-len` is greater /// than zero. When `max-len` is zero, implementations MUST return an empty /// list without trapping. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-random-bytes: func(max-len: u64) -> list; /// Return an insecure pseudo-random `u64` value. /// /// This function returns the same type of pseudo-random data as /// `get-insecure-random-bytes`, represented as a `u64`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-random-u64: func() -> u64; } @@ -63,7 +63,7 @@ interface insecure { /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface random { /// Return up to `max-len` cryptographically-secure random or pseudo-random /// bytes. @@ -85,23 +85,23 @@ interface random { /// This function must always return fresh data. Deterministic environments /// must omit this function, rather than implementing it with deterministic /// data. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-random-bytes: func(max-len: u64) -> list; /// Return a cryptographically-secure random or pseudo-random `u64` value. /// /// This function returns the same type of data as `get-random-bytes`, /// represented as a `u64`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-random-u64: func() -> u64; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import random; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import insecure; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import insecure-seed; } diff --git a/crates/wasi/src/p3/wit/deps/sockets.wit b/crates/wasi/src/p3/wit/deps/sockets.wit index cde2e4d6ebe0..0dd27a4fc4b2 100644 --- a/crates/wasi/src/p3/wit/deps/sockets.wit +++ b/crates/wasi/src/p3/wit/deps/sockets.wit @@ -1,9 +1,9 @@ -package wasi:sockets@0.3.0-rc-2026-03-15; +package wasi:sockets@0.3.0; -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) - use wasi:clocks/types@0.3.0-rc-2026-03-15.{duration}; + @since(version = 0.3.0) + use wasi:clocks/types@0.3.0.{duration}; /// Error codes. /// @@ -16,7 +16,7 @@ interface types { /// - `out-of-memory` /// /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Access denied. /// @@ -80,7 +80,7 @@ interface types { other(option), } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum ip-address-family { /// Similar to `AF_INET` in POSIX. ipv4, @@ -88,19 +88,19 @@ interface types { ipv6, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type ipv4-address = tuple; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type ipv6-address = tuple; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant ip-address { ipv4(ipv4-address), ipv6(ipv6-address), } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record ipv4-socket-address { /// sin_port port: u16, @@ -108,7 +108,7 @@ interface types { address: ipv4-address, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record ipv6-socket-address { /// sin6_port port: u16, @@ -120,7 +120,7 @@ interface types { scope-id: u32, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant ip-socket-address { ipv4(ipv4-socket-address), ipv6(ipv6-socket-address), @@ -135,7 +135,7 @@ interface types { /// - `connecting` /// - `connected` /// - `closed` - /// See + /// See /// for more information. /// /// Note: Except where explicitly mentioned, whenever this documentation uses @@ -158,7 +158,7 @@ interface types { /// In addition to the general error codes documented on the /// `types::error-code` type, TCP socket methods may always return /// `error(invalid-state)` when in the `closed` state. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource tcp-socket { /// Create a new TCP socket. /// @@ -178,7 +178,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create: static func(address-family: ip-address-family) -> result; /// Bind the socket to the provided IP address and port. /// @@ -213,7 +213,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) bind: func(local-address: ip-socket-address) -> result<_, error-code>; /// Connect to a remote endpoint. /// @@ -249,7 +249,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) connect: async func(remote-address: ip-socket-address) -> result<_, error-code>; /// Start listening and return a stream of new inbound connections. /// @@ -321,7 +321,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) listen: func() -> result, error-code>; /// Transmit data to peer. /// @@ -345,7 +345,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) send: func(data: stream) -> future>; /// Read data from peer. /// @@ -374,7 +374,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) receive: func() -> tuple, future>>; /// Get the bound local address. /// @@ -393,7 +393,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-local-address: func() -> result; /// Get the remote address. /// @@ -405,19 +405,19 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-remote-address: func() -> result; /// Whether the socket is in the `listening` state. /// /// Equivalent to the SO_ACCEPTCONN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-is-listening: func() -> bool; /// Whether this is a IPv4 or IPv6 socket. /// /// This is the value passed to the constructor. /// /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-address-family: func() -> ip-address-family; /// Hints the desired listen queue size. Implementations are free to /// ignore this. @@ -430,7 +430,7 @@ interface types { /// - `not-supported`: (set) The platform does not support changing the backlog size after the initial listen. /// - `invalid-argument`: (set) The provided value was 0. /// - `invalid-state`: (set) The socket is in the `connecting` or `connected` state. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-listen-backlog-size: func(value: u64) -> result<_, error-code>; /// Enables or disables keepalive. /// @@ -442,9 +442,9 @@ interface types { /// false, but only come into effect when `keep-alive-enabled` is true. /// /// Equivalent to the SO_KEEPALIVE socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-enabled: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; /// Amount of time the connection has to be idle before TCP starts /// sending keepalive packets. @@ -458,9 +458,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-idle-time: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; /// The time between keepalive packets. /// @@ -473,9 +473,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-interval: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-interval: func(value: duration) -> result<_, error-code>; /// The maximum amount of keepalive packets TCP should send before /// aborting the connection. @@ -489,9 +489,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-count: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-count: func(value: u32) -> result<_, error-code>; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. /// @@ -499,9 +499,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-hop-limit: func(value: u8) -> result<_, error-code>; /// Kernel buffer space reserved for sending/receiving on this socket. /// Implementations usually treat this as a cap the buffer can grow to, @@ -524,18 +524,18 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } /// A UDP socket handle. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource udp-socket { /// Create a new UDP socket. /// @@ -552,7 +552,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create: static func(address-family: ip-address-family) -> result; /// Bind the socket to the provided IP address and port. /// @@ -573,7 +573,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) bind: func(local-address: ip-socket-address) -> result<_, error-code>; /// Associate this socket with a specific peer address. /// @@ -611,7 +611,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) connect: func(remote-address: ip-socket-address) -> result<_, error-code>; /// Dissociate this socket from its peer address. /// @@ -628,7 +628,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) disconnect: func() -> result<_, error-code>; /// Send a message on the socket to a particular peer. /// @@ -672,7 +672,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) send: async func(data: list, remote-address: option) -> result<_, error-code>; /// Receive a message on the socket. /// @@ -697,7 +697,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) receive: async func() -> result, ip-socket-address>, error-code>; /// Get the current bound address. /// @@ -716,7 +716,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-local-address: func() -> result; /// Get the address the socket is currently "connected" to. /// @@ -728,14 +728,14 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-remote-address: func() -> result; /// Whether this is a IPv4 or IPv6 socket. /// /// This is the value passed to the constructor. /// /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-address-family: func() -> ip-address-family; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. /// @@ -743,9 +743,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-unicast-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; /// Kernel buffer space reserved for sending/receiving on this socket. /// Implementations usually treat this as a cap the buffer can grow to, @@ -760,24 +760,24 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface ip-name-lookup { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use types.{ip-address}; /// Lookup error codes. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Access denied. /// @@ -824,16 +824,16 @@ interface ip-name-lookup { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resolve-addresses: async func(name: string) -> result, error-code>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/types@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) + import wasi:clocks/types@0.3.0; + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import ip-name-lookup; } diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs index 7b7e3511e66b..0eb4d2e16a76 100644 --- a/crates/wasmtime/src/config.rs +++ b/crates/wasmtime/src/config.rs @@ -2455,6 +2455,12 @@ impl Config { WasmFeatures::COMPONENT_MODEL, cfg!(feature = "component-model"), ); + features.set( + WasmFeatures::CM_ASYNC, + self.tunables + .concurrency_support + .unwrap_or(cfg!(feature = "component-model-async")), + ); // Next disable any features which the current compiler/target do not // support. This handles cases where Winch, for example, doesn't diff --git a/src/common.rs b/src/common.rs index 204c7cd44d48..db6b48d45eff 100644 --- a/src/common.rs +++ b/src/common.rs @@ -17,7 +17,7 @@ use wasmtime::component::Component; /// /// Currently this is disabled (the `&& false`), but that'll get removed in the /// future. -pub const P3_DEFAULT: bool = cfg!(feature = "component-model-async") && false; +pub const P3_DEFAULT: bool = cfg!(feature = "component-model-async"); #[derive(Clone)] pub enum RunTarget { @@ -472,8 +472,7 @@ impl RunCommon { #[cfg(feature = "component-model-async")] if self.common.wasi.p3.unwrap_or(P3_DEFAULT) { - let mut p3_options = wasmtime_wasi::p3::bindings::LinkOptions::default(); - p3_options.cli_exit_with_code(self.common.wasi.cli_exit_with_code.unwrap_or(false)); + let p3_options = wasmtime_wasi::p3::bindings::LinkOptions::default(); wasmtime_wasi::p3::add_to_linker_with_options(linker, &p3_options) .context("failed to link `wasi:cli@0.3.x`")?; } diff --git a/tests/wasi.rs b/tests/wasi.rs index 0f12c74b2f8f..292cf2dc6231 100644 --- a/tests/wasi.rs +++ b/tests/wasi.rs @@ -15,14 +15,53 @@ use std::path::Path; use std::process::{Child, Stdio}; use tempfile::TempDir; use wasmtime::error::Context; -use wasmtime::{Result, ToWasmtimeResult as _, format_err}; -use wit_component::ComponentEncoder; +use wasmtime::{Result, format_err}; const KNOWN_FAILURES: &[&str] = &[ #[cfg(windows)] "renumber", #[cfg(windows)] "stdio", + // Waiting for the upstream tests to update to use the 0.3.0 official WITs. + "multi-clock-wait", + "filesystem-unlink-errors", + "monotonic-clock", + "filesystem-open-errors", + "cli-terminal", + "sockets-udp-bind", + "wall-clock", + "sockets-tcp-bind", + "cli-env", + "cli-stdio-roundtrip", + "cli-stdio", + "filesystem-flags-and-type", + "sockets-tcp-send", + "filesystem-set-size", + "sockets-udp-connect", + "sockets-echo", + "random", + "sockets-udp-properties", + "filesystem-metadata-hash", + "sockets-tcp-listen", + "sockets-udp-send", + "filesystem-read-directory", + "sockets-tcp-receive", + "sockets-tcp-properties", + "filesystem-dotdot", + "filesystem-io", + "sockets-tcp-connect", + "sockets-udp-receive", + "run-with-err", + "filesystem-advise", + "http-fields", + "http-response", + "filesystem-is-same-object", + "filesystem-rename", + "filesystem-hard-links", + "filesystem-stat", + "http-request", + "filesystem-mkdir-rmdir", + "http-service", ]; fn main() -> Result<()> { @@ -53,16 +92,37 @@ fn find_tests(path: &Path, trials: &mut Vec) -> Result<()> { format!("wasmtime-wasi - {}", path.display()), { let path = path.clone(); - move || run_test(&path, false).map_err(|e| format!("{e:?}").into()) + move || run_test(&path).map_err(|e| format!("{e:?}").into()) }, )); } Ok(()) } -fn run_test(path: &Path, componentize: bool) -> Result<()> { - let wasmtime = Path::new(env!("CARGO_BIN_EXE_wasmtime")); +fn run_test(path: &Path) -> Result<()> { let test_name = path.file_stem().unwrap().to_str().unwrap(); + let mut should_fail = KNOWN_FAILURES.contains(&test_name); + if path.iter().any(|p| p == "wasm32-wasip3") && !cfg!(feature = "component-model-async") { + should_fail = true; + } + match (execute(path), should_fail) { + // If this test passed and is not a known failure, or if it failed and + // it's a known failure, then flag this test as "ok". + (Ok(_), false) | (Err(_), true) => Ok(()), + + // If this test failed and it's not known to fail, explain why. + (Err(e), false) => Err(e), + + // If this test passed but it's flagged as should be failed, then fail + // this test for someone to update `KNOWN_FAILURES`. + (Ok(()), true) => { + wasmtime::bail!("test passed but it's listed in `KNOWN_FAILURES`") + } + } +} + +fn execute(path: &Path) -> Result<()> { + let wasmtime = Path::new(env!("CARGO_BIN_EXE_wasmtime")); let target_dir = wasmtime.parent().unwrap().parent().unwrap(); let parent_dir = path.parent().ok_or(format_err!("module has no parent?"))?; let spec = if let Ok(contents) = fs::read_to_string(&path.with_extension("json")) { @@ -73,26 +133,6 @@ fn run_test(path: &Path, componentize: bool) -> Result<()> { let mut td = TempDir::new_in(&target_dir)?; td.disable_cleanup(true); - let path = if componentize { - let module = fs::read(path).expect("read wasm module"); - let component = ComponentEncoder::default() - .module(module.as_slice()) - .to_wasmtime_result()? - .validate(true) - .adapter( - "wasi_snapshot_preview1", - &fs::read(test_programs_artifacts::ADAPTER_COMMAND)?, - ) - .to_wasmtime_result()? - .encode() - .to_wasmtime_result()?; - let stem = path.file_stem().unwrap().to_str().unwrap(); - let component_path = td.path().join(format!("{stem}.component.wasm")); - fs::write(&component_path, component)?; - component_path - } else { - path.to_path_buf() - }; let spec_debug = format!("{spec:#?}"); let spec_world = spec.world.clone(); @@ -220,14 +260,14 @@ fn run_test(path: &Path, componentize: bool) -> Result<()> { } } let addr = String::from_utf8_lossy(&buf[..i]); - let addr = addr + let Some(addr) = addr .trim() .strip_prefix("Serving HTTP on http://") - .unwrap() - .strip_suffix("/") - .unwrap() - .parse::() - .unwrap(); + .and_then(|s| s.strip_suffix("/")) + .and_then(|s| s.parse::().ok()) + else { + wasmtime::bail!("unexpected output from server: {addr:?}"); + }; http_addr = Some(addr); addr } @@ -256,49 +296,28 @@ fn run_test(path: &Path, componentize: bool) -> Result<()> { let ok = (Some(exit_code.unwrap_or(0)) == result.status.code() || killed) && matches_or_missing(&stdout, &result.stdout) && matches_or_missing(&stderr, &result.stderr); - let mut should_fail = KNOWN_FAILURES.contains(&test_name); - if path.iter().any(|p| p == "wasm32-wasip3") - && !cfg!(feature = "component-model-async") - { - should_fail = true; - } - match (ok, should_fail) { - // If this test passed and is not a known failure, or if it failed and - // it's a known failure, then flag this test as "ok". - (true, false) | (false, true) => {} - - // If this test failed and it's not known to fail, explain why. - (false, false) => { - td.disable_cleanup(false); - let mut msg = String::new(); - writeln!(msg, " command: {cmd_debug}")?; - writeln!(msg, " spec: {spec_debug}")?; - writeln!(msg, " result.status: {}", result.status)?; - if !result.stdout.is_empty() { - write!( - msg, - " result.stdout:\n {}", - String::from_utf8_lossy(&result.stdout).replace("\n", "\n ") - )?; - } - if !result.stderr.is_empty() { - writeln!( - msg, - " result.stderr:\n {}", - String::from_utf8_lossy(&result.stderr).replace("\n", "\n ") - )?; - } - wasmtime::bail!( - "{msg}\nFAILED! The result does not match the specification" - ); + if !ok { + td.disable_cleanup(false); + let mut msg = String::new(); + writeln!(msg, " command: {cmd_debug}")?; + writeln!(msg, " spec: {spec_debug}")?; + writeln!(msg, " result.status: {}", result.status)?; + if !result.stdout.is_empty() { + write!( + msg, + " result.stdout:\n {}", + String::from_utf8_lossy(&result.stdout).replace("\n", "\n ") + )?; } - - // If this test passed but it's flagged as should be failed, then fail - // this test for someone to update `KNOWN_FAILURES`. - (true, true) => { - wasmtime::bail!("test passed but it's listed in `KNOWN_FAILURES`") + if !result.stderr.is_empty() { + writeln!( + msg, + " result.stderr:\n {}", + String::from_utf8_lossy(&result.stderr).replace("\n", "\n ") + )?; } + wasmtime::bail!("{msg}\nFAILED! The result does not match the specification"); } } } From 1231937f38754c7ea78eb98dbcaab3b67a6e637a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 11 Jun 2026 13:02:49 -0700 Subject: [PATCH 2/3] Fix handling an erroneous exit --- tests/wasi.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/wasi.rs b/tests/wasi.rs index 292cf2dc6231..148d3fde9eea 100644 --- a/tests/wasi.rs +++ b/tests/wasi.rs @@ -253,7 +253,9 @@ fn execute(path: &Path) -> Result<()> { let mut i = 0; loop { let n = child.stderr.as_mut().unwrap().read(&mut buf[i..])?; - assert!(n > 0); + if n == 0 { + break; + } i += n; if buf[i - 1] == b'\n' { break; From 4df3edb58332c34d74495b601e1a7ad58114e94b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 11 Jun 2026 20:55:04 -0700 Subject: [PATCH 3/3] Review comments --- src/common.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/common.rs b/src/common.rs index db6b48d45eff..15c0bcea6b84 100644 --- a/src/common.rs +++ b/src/common.rs @@ -14,9 +14,6 @@ use wasmtime_wasi::WasiCtxBuilder; use wasmtime::component::Component; /// Whether or not WASIp3 is enabled by default. -/// -/// Currently this is disabled (the `&& false`), but that'll get removed in the -/// future. pub const P3_DEFAULT: bool = cfg!(feature = "component-model-async"); #[derive(Clone)]