A lightweight WebAssembly runtime that is fast, secure, and standards-compliant
Update WASI WITs to 0.2.12 (#13536)
Alex Crichtonf357442141e5
diff --git a/ci/vendor-wit.sh b/ci/vendor-wit.shindex 5880d81ed2..44b7df5e2c 100755--- a/ci/vendor-wit.sh+++ b/ci/vendor-wit.sh@@ -35,7 +35,7 @@ get_github() {cp -r $cached_extracted_dir/${prefix}/* $path}-p2=0.2.6+p2=0.2.12p3=0.3.0-rc-2026-03-15rm -rf crates/wasi-io/wit/deps@@ -66,6 +66,7 @@ rm -rf crates/wasi-tls/wit/depsmkdir -p crates/wasi-tls/wit/depswkg get --format wit --overwrite "wasi:io@$p2" -o "crates/wasi-tls/wit/deps/io.wit"get_github wasi-tls v0.2.0-draft+505fc98 crates/wasi-tls/wit/deps/tls+sed -i 's/0.2.6/0.2.12/' crates/wasi-tls/wit/deps/tls/types.witrm -rf crates/wasi-tls/src/p3/wit/depsmkdir -p crates/wasi-tls/src/p3/wit/depsdiff --git a/crates/debugger/wit/deps/cli.wit b/crates/debugger/wit/deps/cli.witindex d7a3ca4d2c..07b0437d29 100644--- a/crates/debugger/wit/deps/cli.wit+++ b/crates/debugger/wit/deps/cli.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface environment {@@ -37,7 +37,7 @@ 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.2.12)exit-with-code: func(status-code: u8);}@@ -51,7 +51,7 @@ interface run {@since(version = 0.2.0)interface stdin {@since(version = 0.2.0)- use wasi:io/[email protected].{input-stream};+ use wasi:io/[email protected].{input-stream};@since(version = 0.2.0)get-stdin: func() -> input-stream;@@ -60,7 +60,7 @@ interface stdin {@since(version = 0.2.0)interface stdout {@since(version = 0.2.0)- use wasi:io/[email protected].{output-stream};+ use wasi:io/[email protected].{output-stream};@since(version = 0.2.0)get-stdout: func() -> output-stream;@@ -69,7 +69,7 @@ interface stdout {@since(version = 0.2.0)interface stderr {@since(version = 0.2.0)- use wasi:io/[email protected].{output-stream};+ use wasi:io/[email protected].{output-stream};@since(version = 0.2.0)get-stderr: func() -> output-stream;@@ -145,11 +145,11 @@ world imports {@since(version = 0.2.0)import exit;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import stdin;@since(version = 0.2.0)@@ -166,36 +166,22 @@ world imports {import terminal-stdout;@since(version = 0.2.0)import terminal-stderr;- @since(version = 0.2.0)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@unstable(feature = clocks-timezone)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];+ import wasi:clocks/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];}@since(version = 0.2.0)world command {@@ -204,11 +190,11 @@ world command {@since(version = 0.2.0)import exit;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import stdin;@since(version = 0.2.0)@@ -225,36 +211,22 @@ world command {import terminal-stdout;@since(version = 0.2.0)import terminal-stderr;- @since(version = 0.2.0)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@unstable(feature = clocks-timezone)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];+ import wasi:clocks/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];@since(version = 0.2.0)export run;diff --git a/crates/debugger/wit/deps/clocks.wit b/crates/debugger/wit/deps/clocks.witindex d638f1a40f..06b7d8b257 100644--- a/crates/debugger/wit/deps/clocks.wit+++ b/crates/debugger/wit/deps/clocks.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];/// WASI Monotonic Clock is a clock API intended to let users measure elapsed/// time.@@ -11,7 +11,7 @@ package wasi:[email protected];@since(version = 0.2.0)interface monotonic-clock {@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};/// An instant in time, in nanoseconds. An instant is relative to an/// unspecified initial value, and can only be compared to instances from@@ -27,6 +27,11 @@ interface monotonic-clock {////// The clock is monotonic, therefore calling this function repeatedly will/// produce a sequence of non-decreasing values.+ ///+ /// For completeness, this function traps if it's not possible to represent+ /// the value of the clock in an `instant`. Consequently, implementations+ /// should ensure that the starting time is low enough to avoid the+ /// possibility of overflow in practice.@since(version = 0.2.0)now: func() -> instant;@@ -147,7 +152,7 @@ interface timezone {@since(version = 0.2.0)world imports {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import monotonic-clock;@since(version = 0.2.0)diff --git a/crates/debugger/wit/deps/filesystem.wit b/crates/debugger/wit/deps/filesystem.witindex 9f4a8288b4..5bf8f0aafe 100644--- a/crates/debugger/wit/deps/filesystem.wit+++ b/crates/debugger/wit/deps/filesystem.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];/// WASI filesystem is a filesystem API primarily intended to let users run WASI/// programs that access their files on their existing filesystems, without@@ -27,9 +27,9 @@ package wasi:[email protected];@since(version = 0.2.0)interface types {@since(version = 0.2.0)- use wasi:io/[email protected].{input-stream, output-stream, error};+ use wasi:io/[email protected].{input-stream, output-stream, error};@since(version = 0.2.0)- use wasi:clocks/[email protected].{datetime};+ use wasi:clocks/[email protected].{datetime};/// File size or length of a region within a file.@since(version = 0.2.0)@@ -170,6 +170,7 @@ interface types {}/// A directory entry.+ @since(version = 0.2.0)record directory-entry {/// The type of the file referred to by this directory entry.%type: descriptor-type,@@ -181,6 +182,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.2.0)enum error-code {/// Permission denied, similar to `EACCES` in POSIX.access,@@ -573,13 +575,13 @@ interface preopens {@since(version = 0.2.0)world imports {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@since(version = 0.2.0)import types;@since(version = 0.2.0)diff --git a/crates/debugger/wit/deps/io.wit b/crates/debugger/wit/deps/io.witindex 08ad78e6b7..543cbfc62c 100644--- a/crates/debugger/wit/deps/io.wit+++ b/crates/debugger/wit/deps/io.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface error {@@ -8,14 +8,14 @@ interface error {/// which provides some human-readable information about the error.////// In the `wasi:io` package, this resource is returned through the- /// `wasi:io/streams/stream-error` type.+ /// `wasi:io/streams.stream-error` type.////// To provide more specific error information, other interfaces may/// offer functions to "downcast" this error into more specific types. For example,/// errors returned from streams derived from filesystem types can be described using/// the filesystem's own error-code type. This is done using the function- /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow<error>`- /// parameter and returns an `option<wasi:filesystem/types/error-code>`.+ /// `wasi:filesystem/types.filesystem-error-code`, which takes a `borrow<error>`+ /// parameter and returns an `option<wasi:filesystem/types.error-code>`.////// The set of functions which can "downcast" an `error` into a more/// concrete type is open.@@ -210,27 +210,13 @@ interface streams {/// Perform a write of up to 4096 bytes, and then flush the stream. Block/// until all of these operations are complete, or an error occurs.///- /// This is a convenience wrapper around the use of `check-write`,- /// `subscribe`, `write`, and `flush`, and is implemented with the- /// following pseudo-code:- ///- /// ```text- /// let pollable = this.subscribe();- /// while !contents.is_empty() {- /// // Wait for the stream to become writable- /// pollable.block();- /// let Ok(n) = this.check-write(); // eliding error handling- /// let len = min(n, contents.len());- /// let (chunk, rest) = contents.split_at(len);- /// this.write(chunk ); // eliding error handling- /// contents = rest;- /// }- /// this.flush();- /// // Wait for completion of `flush`- /// pollable.block();- /// // Check for any errors that arose during `flush`- /// let _ = this.check-write(); // eliding error handling- /// ```+ /// Returns success when all of the contents written are successfully+ /// flushed to output. If an error occurs at any point before all+ /// contents are successfully flushed, that error is returned as soon as+ /// possible. If writing and flushing the complete contents causes the+ /// stream to become closed, this call should return success, and+ /// subsequent calls to check-write or other interfaces should return+ /// stream-error::closed.@since(version = 0.2.0)blocking-write-and-flush: func(contents: list<u8>) -> result<_, stream-error>;/// Request to flush buffered output. This function never blocks.@@ -273,26 +259,8 @@ interface streams {/// Block until all of these operations are complete, or an error/// occurs.///- /// This is a convenience wrapper around the use of `check-write`,- /// `subscribe`, `write-zeroes`, and `flush`, and is implemented with- /// the following pseudo-code:- ///- /// ```text- /// let pollable = this.subscribe();- /// while num_zeroes != 0 {- /// // Wait for the stream to become writable- /// pollable.block();- /// let Ok(n) = this.check-write(); // eliding error handling- /// let len = min(n, num_zeroes);- /// this.write-zeroes(len); // eliding error handling- /// num_zeroes -= len;- /// }- /// this.flush();- /// // Wait for completion of `flush`- /// pollable.block();- /// // Check for any errors that arose during `flush`- /// let _ = this.check-write(); // eliding error handling- /// ```+ /// Functionality is equivelant to `blocking-write-and-flush` with+ /// contents given as a list of len containing only zeroes.@since(version = 0.2.0)blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>;/// Read from one stream and write to another.diff --git a/crates/debugger/wit/deps/random.wit b/crates/debugger/wit/deps/random.witindex 73edf5b60e..5b4b2522b9 100644--- a/crates/debugger/wit/deps/random.wit+++ b/crates/debugger/wit/deps/random.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];/// The insecure-seed interface for seeding hash-map DoS resistance.///diff --git a/crates/debugger/wit/deps/sockets.wit b/crates/debugger/wit/deps/sockets.witindex db6d1a23b4..1ac69d2dce 100644--- a/crates/debugger/wit/deps/sockets.wit+++ b/crates/debugger/wit/deps/sockets.wit@@ -1,9 +1,9 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface network {@unstable(feature = network-error-code)- use wasi:io/[email protected].{error};+ use wasi:io/[email protected].{error};/// An opaque resource that represents access to (a subset of) the network./// This enables context-based security for networking.@@ -160,7 +160,7 @@ interface instance-network {@since(version = 0.2.0)interface ip-name-lookup {@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};@since(version = 0.2.0)use network.{network, error-code, ip-address};@@ -216,11 +216,11 @@ interface ip-name-lookup {@since(version = 0.2.0)interface tcp {@since(version = 0.2.0)- use wasi:io/[email protected].{input-stream, output-stream};+ use wasi:io/[email protected].{input-stream, output-stream};@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};@since(version = 0.2.0)- use wasi:clocks/[email protected].{duration};+ use wasi:clocks/[email protected].{duration};@since(version = 0.2.0)use network.{network, error-code, ip-socket-address, ip-address-family};@@ -245,7 +245,7 @@ interface tcp {/// - `connect-in-progress`/// - `connected`/// - `closed`- /// See <https://github.com/WebAssembly/wasi-sockets/blob/main/TcpSocketOperationalSemantics.md>+ /// See <https://github.com/WebAssembly/WASI/blob/main/proposals/sockets/TcpSocketOperationalSemantics.md>/// for more information.////// Note: Except where explicitly mentioned, whenever this documentation uses@@ -548,7 +548,7 @@ interface tcp {/// `subscribe` only has to be called once per socket and can then be/// (re)used for the remainder of the socket's lifetime.///- /// See <https://github.com/WebAssembly/wasi-sockets/blob/main/TcpSocketOperationalSemantics.md#pollable-readiness>+ /// See <https://github.com/WebAssembly/WASI/blob/main/proposals/sockets/TcpSocketOperationalSemantics.md#pollable-readiness>/// for more information.////// Note: this function is here for WASI 0.2 only.@@ -617,7 +617,7 @@ interface tcp-create-socket {@since(version = 0.2.0)interface udp {@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};@since(version = 0.2.0)use network.{network, error-code, ip-socket-address, ip-address-family};@@ -925,21 +925,21 @@ interface udp-create-socket {@since(version = 0.2.0)world imports {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import network;@since(version = 0.2.0)import instance-network;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import udp;@since(version = 0.2.0)import udp-create-socket;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@since(version = 0.2.0)import tcp;@since(version = 0.2.0)diff --git a/crates/debugger/wit/world.wit b/crates/debugger/wit/world.witindex 8ce5378da6..0931e61ab4 100644--- a/crates/debugger/wit/world.wit+++ b/crates/debugger/wit/world.wit@@ -1,7 +1,7 @@package bytecodealliance:[email protected];world debug-main {- import wasi:io/[email protected];+ import wasi:io/[email protected];import debuggee;/// Print an informational message from the debugger (e.g. "listening@@ -25,7 +25,7 @@ interface debugger {}interface debuggee {- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};/// A debuggee consisting of one Store over which we have/// debugging control.diff --git a/crates/gdbstub-component/src/api.rs b/crates/gdbstub-component/src/api.rsindex a33e3057a9..6c3416c5ab 100644--- a/crates/gdbstub-component/src/api.rs+++ b/crates/gdbstub-component/src/api.rs@@ -6,7 +6,7 @@ wit_bindgen::generate!({world: "bytecodealliance:wasmtime/debug-main",path: "../debugger/wit",with: {- "wasi:io/[email protected]": wasip2::io::poll,+ "wasi:io/[email protected]": wasip2::io::poll,}});pub(crate) use bytecodealliance::wasmtime::debuggee::*;diff --git a/crates/test-programs/src/bin/debugger_component.rs b/crates/test-programs/src/bin/debugger_component.rsindex 482d6d1f15..e398970f2c 100644--- a/crates/test-programs/src/bin/debugger_component.rs+++ b/crates/test-programs/src/bin/debugger_component.rs@@ -11,7 +11,7 @@ mod api {world: "bytecodealliance:wasmtime/debug-main",path: "../../crates/debugger/wit",with: {- "wasi:io/[email protected]": wasip2::io::poll,+ "wasi:io/[email protected]": wasip2::io::poll,}});}diff --git a/crates/test-programs/src/lib.rs b/crates/test-programs/src/lib.rsindex 82dbbdf254..dce5d3c979 100644--- a/crates/test-programs/src/lib.rs+++ b/crates/test-programs/src/lib.rs@@ -11,8 +11,8 @@ wit_bindgen::generate!({package wasmtime:test;world test {- include wasi:cli/[email protected];- include wasi:http/[email protected];+ include wasi:cli/[email protected];+ include wasi:http/[email protected];include wasi:config/[email protected];include wasi:keyvalue/[email protected];include wasi:tls/[email protected];@@ -36,17 +36,17 @@ pub mod proxy {default_bindings_module: "test_programs::proxy",pub_export_macro: true,with: {- "wasi:http/[email protected]": crate::wasi::http::types,- "wasi:http/[email protected]": crate::wasi::http::outgoing_handler,- "wasi:random/[email protected]": crate::wasi::random::random,- "wasi:io/[email protected]": crate::wasi::io::error,- "wasi:io/[email protected]": crate::wasi::io::poll,- "wasi:io/[email protected]": crate::wasi::io::streams,- "wasi:cli/[email protected]": crate::wasi::cli::stdout,- "wasi:cli/[email protected]": crate::wasi::cli::stderr,- "wasi:cli/[email protected]": crate::wasi::cli::stdin,- "wasi:clocks/[email protected]": crate::wasi::clocks::monotonic_clock,- "wasi:clocks/[email protected]": crate::wasi::clocks::wall_clock,+ "wasi:http/[email protected]": crate::wasi::http::types,+ "wasi:http/[email protected]": crate::wasi::http::outgoing_handler,+ "wasi:random/[email protected]": crate::wasi::random::random,+ "wasi:io/[email protected]": crate::wasi::io::error,+ "wasi:io/[email protected]": crate::wasi::io::poll,+ "wasi:io/[email protected]": crate::wasi::io::streams,+ "wasi:cli/[email protected]": crate::wasi::cli::stdout,+ "wasi:cli/[email protected]": crate::wasi::cli::stderr,+ "wasi:cli/[email protected]": crate::wasi::cli::stdin,+ "wasi:clocks/[email protected]": crate::wasi::clocks::monotonic_clock,+ "wasi:clocks/[email protected]": crate::wasi::clocks::wall_clock,},});}diff --git a/crates/wasi-http/wit/deps/cli.wit b/crates/wasi-http/wit/deps/cli.witindex d7a3ca4d2c..07b0437d29 100644--- a/crates/wasi-http/wit/deps/cli.wit+++ b/crates/wasi-http/wit/deps/cli.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface environment {@@ -37,7 +37,7 @@ 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.2.12)exit-with-code: func(status-code: u8);}@@ -51,7 +51,7 @@ interface run {@since(version = 0.2.0)interface stdin {@since(version = 0.2.0)- use wasi:io/[email protected].{input-stream};+ use wasi:io/[email protected].{input-stream};@since(version = 0.2.0)get-stdin: func() -> input-stream;@@ -60,7 +60,7 @@ interface stdin {@since(version = 0.2.0)interface stdout {@since(version = 0.2.0)- use wasi:io/[email protected].{output-stream};+ use wasi:io/[email protected].{output-stream};@since(version = 0.2.0)get-stdout: func() -> output-stream;@@ -69,7 +69,7 @@ interface stdout {@since(version = 0.2.0)interface stderr {@since(version = 0.2.0)- use wasi:io/[email protected].{output-stream};+ use wasi:io/[email protected].{output-stream};@since(version = 0.2.0)get-stderr: func() -> output-stream;@@ -145,11 +145,11 @@ world imports {@since(version = 0.2.0)import exit;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import stdin;@since(version = 0.2.0)@@ -166,36 +166,22 @@ world imports {import terminal-stdout;@since(version = 0.2.0)import terminal-stderr;- @since(version = 0.2.0)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@unstable(feature = clocks-timezone)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];+ import wasi:clocks/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];}@since(version = 0.2.0)world command {@@ -204,11 +190,11 @@ world command {@since(version = 0.2.0)import exit;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import stdin;@since(version = 0.2.0)@@ -225,36 +211,22 @@ world command {import terminal-stdout;@since(version = 0.2.0)import terminal-stderr;- @since(version = 0.2.0)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@unstable(feature = clocks-timezone)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];+ import wasi:clocks/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];@since(version = 0.2.0)export run;diff --git a/crates/wasi-http/wit/deps/clocks.wit b/crates/wasi-http/wit/deps/clocks.witindex d638f1a40f..06b7d8b257 100644--- a/crates/wasi-http/wit/deps/clocks.wit+++ b/crates/wasi-http/wit/deps/clocks.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];/// WASI Monotonic Clock is a clock API intended to let users measure elapsed/// time.@@ -11,7 +11,7 @@ package wasi:[email protected];@since(version = 0.2.0)interface monotonic-clock {@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};/// An instant in time, in nanoseconds. An instant is relative to an/// unspecified initial value, and can only be compared to instances from@@ -27,6 +27,11 @@ interface monotonic-clock {////// The clock is monotonic, therefore calling this function repeatedly will/// produce a sequence of non-decreasing values.+ ///+ /// For completeness, this function traps if it's not possible to represent+ /// the value of the clock in an `instant`. Consequently, implementations+ /// should ensure that the starting time is low enough to avoid the+ /// possibility of overflow in practice.@since(version = 0.2.0)now: func() -> instant;@@ -147,7 +152,7 @@ interface timezone {@since(version = 0.2.0)world imports {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import monotonic-clock;@since(version = 0.2.0)diff --git a/crates/wasi-http/wit/deps/filesystem.wit b/crates/wasi-http/wit/deps/filesystem.witindex 9f4a8288b4..5bf8f0aafe 100644--- a/crates/wasi-http/wit/deps/filesystem.wit+++ b/crates/wasi-http/wit/deps/filesystem.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];/// WASI filesystem is a filesystem API primarily intended to let users run WASI/// programs that access their files on their existing filesystems, without@@ -27,9 +27,9 @@ package wasi:[email protected];@since(version = 0.2.0)interface types {@since(version = 0.2.0)- use wasi:io/[email protected].{input-stream, output-stream, error};+ use wasi:io/[email protected].{input-stream, output-stream, error};@since(version = 0.2.0)- use wasi:clocks/[email protected].{datetime};+ use wasi:clocks/[email protected].{datetime};/// File size or length of a region within a file.@since(version = 0.2.0)@@ -170,6 +170,7 @@ interface types {}/// A directory entry.+ @since(version = 0.2.0)record directory-entry {/// The type of the file referred to by this directory entry.%type: descriptor-type,@@ -181,6 +182,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.2.0)enum error-code {/// Permission denied, similar to `EACCES` in POSIX.access,@@ -573,13 +575,13 @@ interface preopens {@since(version = 0.2.0)world imports {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@since(version = 0.2.0)import types;@since(version = 0.2.0)diff --git a/crates/wasi-http/wit/deps/http.wit b/crates/wasi-http/wit/deps/http.witindex eb1b25f024..7de544730c 100644--- a/crates/wasi-http/wit/deps/http.wit+++ b/crates/wasi-http/wit/deps/http.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];/// This interface defines all of the types and methods for implementing/// HTTP Requests and Responses, both incoming and outgoing, as well as@@ -6,13 +6,13 @@ package wasi:[email protected];@since(version = 0.2.0)interface types {@since(version = 0.2.0)- use wasi:clocks/[email protected].{duration};+ use wasi:clocks/[email protected].{duration};@since(version = 0.2.0)- use wasi:io/[email protected].{input-stream, output-stream};+ use wasi:io/[email protected].{input-stream, output-stream};@since(version = 0.2.0)- use wasi:io/[email protected].{error as io-error};+ use wasi:io/[email protected].{error as io-error};@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};/// This type corresponds to HTTP standard Methods.@since(version = 0.2.0)@@ -619,8 +619,8 @@ interface types {/// provided.////// Stream operations which return- /// `wasi:io/stream/stream-error::last-operation-failed` have a payload of- /// type `wasi:io/error/error` with more information about the operation+ /// `wasi:io/stream.stream-error.last-operation-failed` have a payload of+ /// type `wasi:io/error.error` with more information about the operation/// that failed. This payload can be passed through to this function to see/// if there's http-related information about the error to return.///@@ -677,23 +677,23 @@ interface outgoing-handler {@since(version = 0.2.0)world imports {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@since(version = 0.2.0)- import wasi:random/[email protected];+ import wasi:random/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:cli/[email protected];+ import wasi:cli/[email protected];@since(version = 0.2.0)- import wasi:cli/[email protected];+ import wasi:cli/[email protected];@since(version = 0.2.0)- import wasi:cli/[email protected];+ import wasi:cli/[email protected];@since(version = 0.2.0)import types;@since(version = 0.2.0)@@ -706,23 +706,23 @@ world imports {@since(version = 0.2.0)world proxy {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@since(version = 0.2.0)- import wasi:random/[email protected];+ import wasi:random/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:cli/[email protected];+ import wasi:cli/[email protected];@since(version = 0.2.0)- import wasi:cli/[email protected];+ import wasi:cli/[email protected];@since(version = 0.2.0)- import wasi:cli/[email protected];+ import wasi:cli/[email protected];@since(version = 0.2.0)import types;@since(version = 0.2.0)diff --git a/crates/wasi-http/wit/deps/io.wit b/crates/wasi-http/wit/deps/io.witindex 08ad78e6b7..543cbfc62c 100644--- a/crates/wasi-http/wit/deps/io.wit+++ b/crates/wasi-http/wit/deps/io.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface error {@@ -8,14 +8,14 @@ interface error {/// which provides some human-readable information about the error.////// In the `wasi:io` package, this resource is returned through the- /// `wasi:io/streams/stream-error` type.+ /// `wasi:io/streams.stream-error` type.////// To provide more specific error information, other interfaces may/// offer functions to "downcast" this error into more specific types. For example,/// errors returned from streams derived from filesystem types can be described using/// the filesystem's own error-code type. This is done using the function- /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow<error>`- /// parameter and returns an `option<wasi:filesystem/types/error-code>`.+ /// `wasi:filesystem/types.filesystem-error-code`, which takes a `borrow<error>`+ /// parameter and returns an `option<wasi:filesystem/types.error-code>`.////// The set of functions which can "downcast" an `error` into a more/// concrete type is open.@@ -210,27 +210,13 @@ interface streams {/// Perform a write of up to 4096 bytes, and then flush the stream. Block/// until all of these operations are complete, or an error occurs.///- /// This is a convenience wrapper around the use of `check-write`,- /// `subscribe`, `write`, and `flush`, and is implemented with the- /// following pseudo-code:- ///- /// ```text- /// let pollable = this.subscribe();- /// while !contents.is_empty() {- /// // Wait for the stream to become writable- /// pollable.block();- /// let Ok(n) = this.check-write(); // eliding error handling- /// let len = min(n, contents.len());- /// let (chunk, rest) = contents.split_at(len);- /// this.write(chunk ); // eliding error handling- /// contents = rest;- /// }- /// this.flush();- /// // Wait for completion of `flush`- /// pollable.block();- /// // Check for any errors that arose during `flush`- /// let _ = this.check-write(); // eliding error handling- /// ```+ /// Returns success when all of the contents written are successfully+ /// flushed to output. If an error occurs at any point before all+ /// contents are successfully flushed, that error is returned as soon as+ /// possible. If writing and flushing the complete contents causes the+ /// stream to become closed, this call should return success, and+ /// subsequent calls to check-write or other interfaces should return+ /// stream-error::closed.@since(version = 0.2.0)blocking-write-and-flush: func(contents: list<u8>) -> result<_, stream-error>;/// Request to flush buffered output. This function never blocks.@@ -273,26 +259,8 @@ interface streams {/// Block until all of these operations are complete, or an error/// occurs.///- /// This is a convenience wrapper around the use of `check-write`,- /// `subscribe`, `write-zeroes`, and `flush`, and is implemented with- /// the following pseudo-code:- ///- /// ```text- /// let pollable = this.subscribe();- /// while num_zeroes != 0 {- /// // Wait for the stream to become writable- /// pollable.block();- /// let Ok(n) = this.check-write(); // eliding error handling- /// let len = min(n, num_zeroes);- /// this.write-zeroes(len); // eliding error handling- /// num_zeroes -= len;- /// }- /// this.flush();- /// // Wait for completion of `flush`- /// pollable.block();- /// // Check for any errors that arose during `flush`- /// let _ = this.check-write(); // eliding error handling- /// ```+ /// Functionality is equivelant to `blocking-write-and-flush` with+ /// contents given as a list of len containing only zeroes.@since(version = 0.2.0)blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>;/// Read from one stream and write to another.diff --git a/crates/wasi-http/wit/deps/random.wit b/crates/wasi-http/wit/deps/random.witindex 73edf5b60e..5b4b2522b9 100644--- a/crates/wasi-http/wit/deps/random.wit+++ b/crates/wasi-http/wit/deps/random.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];/// The insecure-seed interface for seeding hash-map DoS resistance.///diff --git a/crates/wasi-http/wit/deps/sockets.wit b/crates/wasi-http/wit/deps/sockets.witindex db6d1a23b4..1ac69d2dce 100644--- a/crates/wasi-http/wit/deps/sockets.wit+++ b/crates/wasi-http/wit/deps/sockets.wit@@ -1,9 +1,9 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface network {@unstable(feature = network-error-code)- use wasi:io/[email protected].{error};+ use wasi:io/[email protected].{error};/// An opaque resource that represents access to (a subset of) the network./// This enables context-based security for networking.@@ -160,7 +160,7 @@ interface instance-network {@since(version = 0.2.0)interface ip-name-lookup {@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};@since(version = 0.2.0)use network.{network, error-code, ip-address};@@ -216,11 +216,11 @@ interface ip-name-lookup {@since(version = 0.2.0)interface tcp {@since(version = 0.2.0)- use wasi:io/[email protected].{input-stream, output-stream};+ use wasi:io/[email protected].{input-stream, output-stream};@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};@since(version = 0.2.0)- use wasi:clocks/[email protected].{duration};+ use wasi:clocks/[email protected].{duration};@since(version = 0.2.0)use network.{network, error-code, ip-socket-address, ip-address-family};@@ -245,7 +245,7 @@ interface tcp {/// - `connect-in-progress`/// - `connected`/// - `closed`- /// See <https://github.com/WebAssembly/wasi-sockets/blob/main/TcpSocketOperationalSemantics.md>+ /// See <https://github.com/WebAssembly/WASI/blob/main/proposals/sockets/TcpSocketOperationalSemantics.md>/// for more information.////// Note: Except where explicitly mentioned, whenever this documentation uses@@ -548,7 +548,7 @@ interface tcp {/// `subscribe` only has to be called once per socket and can then be/// (re)used for the remainder of the socket's lifetime.///- /// See <https://github.com/WebAssembly/wasi-sockets/blob/main/TcpSocketOperationalSemantics.md#pollable-readiness>+ /// See <https://github.com/WebAssembly/WASI/blob/main/proposals/sockets/TcpSocketOperationalSemantics.md#pollable-readiness>/// for more information.////// Note: this function is here for WASI 0.2 only.@@ -617,7 +617,7 @@ interface tcp-create-socket {@since(version = 0.2.0)interface udp {@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};@since(version = 0.2.0)use network.{network, error-code, ip-socket-address, ip-address-family};@@ -925,21 +925,21 @@ interface udp-create-socket {@since(version = 0.2.0)world imports {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import network;@since(version = 0.2.0)import instance-network;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import udp;@since(version = 0.2.0)import udp-create-socket;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@since(version = 0.2.0)import tcp;@since(version = 0.2.0)diff --git a/crates/wasi-http/wit/world.wit b/crates/wasi-http/wit/world.witindex 69793510df..bd1d852c7d 100644--- a/crates/wasi-http/wit/world.wit+++ b/crates/wasi-http/wit/world.wit@@ -2,5 +2,5 @@package wasmtime:wasi-http;world bindings {- include wasi:http/[email protected];+ include wasi:http/[email protected];}diff --git a/crates/wasi-io/wit/deps/io.wit b/crates/wasi-io/wit/deps/io.witindex 08ad78e6b7..543cbfc62c 100644--- a/crates/wasi-io/wit/deps/io.wit+++ b/crates/wasi-io/wit/deps/io.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface error {@@ -8,14 +8,14 @@ interface error {/// which provides some human-readable information about the error.////// In the `wasi:io` package, this resource is returned through the- /// `wasi:io/streams/stream-error` type.+ /// `wasi:io/streams.stream-error` type.////// To provide more specific error information, other interfaces may/// offer functions to "downcast" this error into more specific types. For example,/// errors returned from streams derived from filesystem types can be described using/// the filesystem's own error-code type. This is done using the function- /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow<error>`- /// parameter and returns an `option<wasi:filesystem/types/error-code>`.+ /// `wasi:filesystem/types.filesystem-error-code`, which takes a `borrow<error>`+ /// parameter and returns an `option<wasi:filesystem/types.error-code>`.////// The set of functions which can "downcast" an `error` into a more/// concrete type is open.@@ -210,27 +210,13 @@ interface streams {/// Perform a write of up to 4096 bytes, and then flush the stream. Block/// until all of these operations are complete, or an error occurs.///- /// This is a convenience wrapper around the use of `check-write`,- /// `subscribe`, `write`, and `flush`, and is implemented with the- /// following pseudo-code:- ///- /// ```text- /// let pollable = this.subscribe();- /// while !contents.is_empty() {- /// // Wait for the stream to become writable- /// pollable.block();- /// let Ok(n) = this.check-write(); // eliding error handling- /// let len = min(n, contents.len());- /// let (chunk, rest) = contents.split_at(len);- /// this.write(chunk ); // eliding error handling- /// contents = rest;- /// }- /// this.flush();- /// // Wait for completion of `flush`- /// pollable.block();- /// // Check for any errors that arose during `flush`- /// let _ = this.check-write(); // eliding error handling- /// ```+ /// Returns success when all of the contents written are successfully+ /// flushed to output. If an error occurs at any point before all+ /// contents are successfully flushed, that error is returned as soon as+ /// possible. If writing and flushing the complete contents causes the+ /// stream to become closed, this call should return success, and+ /// subsequent calls to check-write or other interfaces should return+ /// stream-error::closed.@since(version = 0.2.0)blocking-write-and-flush: func(contents: list<u8>) -> result<_, stream-error>;/// Request to flush buffered output. This function never blocks.@@ -273,26 +259,8 @@ interface streams {/// Block until all of these operations are complete, or an error/// occurs.///- /// This is a convenience wrapper around the use of `check-write`,- /// `subscribe`, `write-zeroes`, and `flush`, and is implemented with- /// the following pseudo-code:- ///- /// ```text- /// let pollable = this.subscribe();- /// while num_zeroes != 0 {- /// // Wait for the stream to become writable- /// pollable.block();- /// let Ok(n) = this.check-write(); // eliding error handling- /// let len = min(n, num_zeroes);- /// this.write-zeroes(len); // eliding error handling- /// num_zeroes -= len;- /// }- /// this.flush();- /// // Wait for completion of `flush`- /// pollable.block();- /// // Check for any errors that arose during `flush`- /// let _ = this.check-write(); // eliding error handling- /// ```+ /// Functionality is equivelant to `blocking-write-and-flush` with+ /// contents given as a list of len containing only zeroes.@since(version = 0.2.0)blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>;/// Read from one stream and write to another.diff --git a/crates/wasi-io/wit/world.wit b/crates/wasi-io/wit/world.witindex 09dcb03b76..5cb80b58d7 100644--- a/crates/wasi-io/wit/world.wit+++ b/crates/wasi-io/wit/world.wit@@ -2,5 +2,5 @@package wasmtime:wasi-io;world bindings {- include wasi:io/[email protected];+ include wasi:io/[email protected];}diff --git a/crates/wasi-preview1-component-adapter/src/lib.rs b/crates/wasi-preview1-component-adapter/src/lib.rsindex 7235c1f24d..ddda105fd4 100644--- a/crates/wasi-preview1-component-adapter/src/lib.rs+++ b/crates/wasi-preview1-component-adapter/src/lib.rs@@ -99,12 +99,12 @@ pub mod bindings {package wasmtime:adapter;world adapter {- import wasi:clocks/[email protected];- import wasi:clocks/[email protected];- import wasi:random/[email protected];- import wasi:cli/[email protected];- import wasi:cli/[email protected];- import wasi:cli/[email protected];+ import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];+ import wasi:random/[email protected];+ import wasi:cli/[email protected];+ import wasi:cli/[email protected];+ import wasi:cli/[email protected];}"#,world: "wasmtime:adapter/adapter",@@ -122,7 +122,7 @@ pub mod bindings {}}-#[unsafe(export_name = "wasi:cli/[email protected]#run")]+#[unsafe(export_name = "wasi:cli/[email protected]#run")]#[cfg(feature = "command")]pub extern "C" fn run() -> u32 {#[link(wasm_import_module = "__main_module__")]@@ -469,7 +469,7 @@ impl BumpAlloc {}#[cfg(not(feature = "proxy"))]-#[link(wasm_import_module = "wasi:cli/[email protected]")]+#[link(wasm_import_module = "wasi:cli/[email protected]")]unsafe extern "C" {#[link_name = "get-arguments"]fn wasi_cli_get_arguments(rval: *mut WasmStrList);@@ -2199,7 +2199,7 @@ pub unsafe extern "C" fn poll_oneoff(}}- #[link(wasm_import_module = "wasi:io/[email protected]")]+ #[link(wasm_import_module = "wasi:io/[email protected]")]unsafe extern "C" {#[link_name = "poll"]fn poll_import(pollables: *const Pollable, len: usize, rval: *mut ReadyList);diff --git a/crates/wasi-tls/wit/deps/io.wit b/crates/wasi-tls/wit/deps/io.witindex 08ad78e6b7..543cbfc62c 100644--- a/crates/wasi-tls/wit/deps/io.wit+++ b/crates/wasi-tls/wit/deps/io.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface error {@@ -8,14 +8,14 @@ interface error {/// which provides some human-readable information about the error.////// In the `wasi:io` package, this resource is returned through the- /// `wasi:io/streams/stream-error` type.+ /// `wasi:io/streams.stream-error` type.////// To provide more specific error information, other interfaces may/// offer functions to "downcast" this error into more specific types. For example,/// errors returned from streams derived from filesystem types can be described using/// the filesystem's own error-code type. This is done using the function- /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow<error>`- /// parameter and returns an `option<wasi:filesystem/types/error-code>`.+ /// `wasi:filesystem/types.filesystem-error-code`, which takes a `borrow<error>`+ /// parameter and returns an `option<wasi:filesystem/types.error-code>`.////// The set of functions which can "downcast" an `error` into a more/// concrete type is open.@@ -210,27 +210,13 @@ interface streams {/// Perform a write of up to 4096 bytes, and then flush the stream. Block/// until all of these operations are complete, or an error occurs.///- /// This is a convenience wrapper around the use of `check-write`,- /// `subscribe`, `write`, and `flush`, and is implemented with the- /// following pseudo-code:- ///- /// ```text- /// let pollable = this.subscribe();- /// while !contents.is_empty() {- /// // Wait for the stream to become writable- /// pollable.block();- /// let Ok(n) = this.check-write(); // eliding error handling- /// let len = min(n, contents.len());- /// let (chunk, rest) = contents.split_at(len);- /// this.write(chunk ); // eliding error handling- /// contents = rest;- /// }- /// this.flush();- /// // Wait for completion of `flush`- /// pollable.block();- /// // Check for any errors that arose during `flush`- /// let _ = this.check-write(); // eliding error handling- /// ```+ /// Returns success when all of the contents written are successfully+ /// flushed to output. If an error occurs at any point before all+ /// contents are successfully flushed, that error is returned as soon as+ /// possible. If writing and flushing the complete contents causes the+ /// stream to become closed, this call should return success, and+ /// subsequent calls to check-write or other interfaces should return+ /// stream-error::closed.@since(version = 0.2.0)blocking-write-and-flush: func(contents: list<u8>) -> result<_, stream-error>;/// Request to flush buffered output. This function never blocks.@@ -273,26 +259,8 @@ interface streams {/// Block until all of these operations are complete, or an error/// occurs.///- /// This is a convenience wrapper around the use of `check-write`,- /// `subscribe`, `write-zeroes`, and `flush`, and is implemented with- /// the following pseudo-code:- ///- /// ```text- /// let pollable = this.subscribe();- /// while num_zeroes != 0 {- /// // Wait for the stream to become writable- /// pollable.block();- /// let Ok(n) = this.check-write(); // eliding error handling- /// let len = min(n, num_zeroes);- /// this.write-zeroes(len); // eliding error handling- /// num_zeroes -= len;- /// }- /// this.flush();- /// // Wait for completion of `flush`- /// pollable.block();- /// // Check for any errors that arose during `flush`- /// let _ = this.check-write(); // eliding error handling- /// ```+ /// Functionality is equivelant to `blocking-write-and-flush` with+ /// contents given as a list of len containing only zeroes.@since(version = 0.2.0)blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>;/// Read from one stream and write to another.diff --git a/crates/wasi-tls/wit/deps/tls/types.wit b/crates/wasi-tls/wit/deps/tls/types.witindex f6b69b3f04..a261dc01a1 100644--- a/crates/wasi-tls/wit/deps/tls/types.wit+++ b/crates/wasi-tls/wit/deps/tls/types.wit@@ -1,11 +1,11 @@@unstable(feature = tls)interface types {@unstable(feature = tls)- use wasi:io/[email protected].{input-stream, output-stream};+ use wasi:io/[email protected].{input-stream, output-stream};@unstable(feature = tls)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};@unstable(feature = tls)- use wasi:io/[email protected].{error as io-error};+ use wasi:io/[email protected].{error as io-error};@unstable(feature = tls)resource client-handshake {diff --git a/crates/wasi/src/p2/bindings.rs b/crates/wasi/src/p2/bindings.rsindex db60468b28..4d68bfd689 100644--- a/crates/wasi/src/p2/bindings.rs+++ b/crates/wasi/src/p2/bindings.rs@@ -26,7 +26,7 @@//! // An example of extending the `wasi:cli/command` world with a//! // custom host interface.//! world my-world {-//! include wasi:cli/[email protected];+//! include wasi:cli/[email protected];//!//! import custom-host;//! }@@ -94,7 +94,7 @@/// // An example of extending the `wasi:cli/command` world with a/// // custom host interface./// world my-world {-/// include wasi:cli/[email protected];+/// include wasi:cli/[email protected];////// import custom-host;/// }diff --git a/crates/wasi/src/p2/mod.rs b/crates/wasi/src/p2/mod.rsindex 3c1431e83d..7b34ddd0a9 100644--- a/crates/wasi/src/p2/mod.rs+++ b/crates/wasi/src/p2/mod.rs@@ -337,7 +337,6 @@ fn add_nonblocking_to_linker<'a, T: WasiView, O>() -> wasmtime::Result<()>wherebindings::sockets::network::LinkOptions: From<&'a O>,- bindings::cli::exit::LinkOptions: From<&'a O>,{use crate::p2::bindings::{cli, clocks, filesystem, random, sockets};@@ -348,7 +347,7 @@ whererandom::random::add_to_linker::<T, WasiRandom>(l, |t| &mut t.ctx().ctx.random)?;random::insecure::add_to_linker::<T, WasiRandom>(l, |t| &mut t.ctx().ctx.random)?;random::insecure_seed::add_to_linker::<T, WasiRandom>(l, |t| &mut t.ctx().ctx.random)?;- cli::exit::add_to_linker::<T, WasiCli>(l, &options.into(), T::cli)?;+ cli::exit::add_to_linker::<T, WasiCli>(l, T::cli)?;cli::environment::add_to_linker::<T, WasiCli>(l, T::cli)?;cli::stdin::add_to_linker::<T, WasiCli>(l, T::cli)?;cli::stdout::add_to_linker::<T, WasiCli>(l, T::cli)?;diff --git a/crates/wasi/src/p2/wit/deps/cli.wit b/crates/wasi/src/p2/wit/deps/cli.witindex d7a3ca4d2c..07b0437d29 100644--- a/crates/wasi/src/p2/wit/deps/cli.wit+++ b/crates/wasi/src/p2/wit/deps/cli.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface environment {@@ -37,7 +37,7 @@ 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.2.12)exit-with-code: func(status-code: u8);}@@ -51,7 +51,7 @@ interface run {@since(version = 0.2.0)interface stdin {@since(version = 0.2.0)- use wasi:io/[email protected].{input-stream};+ use wasi:io/[email protected].{input-stream};@since(version = 0.2.0)get-stdin: func() -> input-stream;@@ -60,7 +60,7 @@ interface stdin {@since(version = 0.2.0)interface stdout {@since(version = 0.2.0)- use wasi:io/[email protected].{output-stream};+ use wasi:io/[email protected].{output-stream};@since(version = 0.2.0)get-stdout: func() -> output-stream;@@ -69,7 +69,7 @@ interface stdout {@since(version = 0.2.0)interface stderr {@since(version = 0.2.0)- use wasi:io/[email protected].{output-stream};+ use wasi:io/[email protected].{output-stream};@since(version = 0.2.0)get-stderr: func() -> output-stream;@@ -145,11 +145,11 @@ world imports {@since(version = 0.2.0)import exit;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import stdin;@since(version = 0.2.0)@@ -166,36 +166,22 @@ world imports {import terminal-stdout;@since(version = 0.2.0)import terminal-stderr;- @since(version = 0.2.0)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@unstable(feature = clocks-timezone)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];+ import wasi:clocks/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];}@since(version = 0.2.0)world command {@@ -204,11 +190,11 @@ world command {@since(version = 0.2.0)import exit;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import stdin;@since(version = 0.2.0)@@ -225,36 +211,22 @@ world command {import terminal-stdout;@since(version = 0.2.0)import terminal-stderr;- @since(version = 0.2.0)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@unstable(feature = clocks-timezone)- import wasi:clocks/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:filesystem/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:sockets/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];- @since(version = 0.2.0)- import wasi:random/[email protected];+ import wasi:clocks/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:filesystem/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:sockets/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];+ import wasi:random/[email protected];@since(version = 0.2.0)export run;diff --git a/crates/wasi/src/p2/wit/deps/clocks.wit b/crates/wasi/src/p2/wit/deps/clocks.witindex d638f1a40f..06b7d8b257 100644--- a/crates/wasi/src/p2/wit/deps/clocks.wit+++ b/crates/wasi/src/p2/wit/deps/clocks.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];/// WASI Monotonic Clock is a clock API intended to let users measure elapsed/// time.@@ -11,7 +11,7 @@ package wasi:[email protected];@since(version = 0.2.0)interface monotonic-clock {@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};/// An instant in time, in nanoseconds. An instant is relative to an/// unspecified initial value, and can only be compared to instances from@@ -27,6 +27,11 @@ interface monotonic-clock {////// The clock is monotonic, therefore calling this function repeatedly will/// produce a sequence of non-decreasing values.+ ///+ /// For completeness, this function traps if it's not possible to represent+ /// the value of the clock in an `instant`. Consequently, implementations+ /// should ensure that the starting time is low enough to avoid the+ /// possibility of overflow in practice.@since(version = 0.2.0)now: func() -> instant;@@ -147,7 +152,7 @@ interface timezone {@since(version = 0.2.0)world imports {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import monotonic-clock;@since(version = 0.2.0)diff --git a/crates/wasi/src/p2/wit/deps/filesystem.wit b/crates/wasi/src/p2/wit/deps/filesystem.witindex 9f4a8288b4..5bf8f0aafe 100644--- a/crates/wasi/src/p2/wit/deps/filesystem.wit+++ b/crates/wasi/src/p2/wit/deps/filesystem.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];/// WASI filesystem is a filesystem API primarily intended to let users run WASI/// programs that access their files on their existing filesystems, without@@ -27,9 +27,9 @@ package wasi:[email protected];@since(version = 0.2.0)interface types {@since(version = 0.2.0)- use wasi:io/[email protected].{input-stream, output-stream, error};+ use wasi:io/[email protected].{input-stream, output-stream, error};@since(version = 0.2.0)- use wasi:clocks/[email protected].{datetime};+ use wasi:clocks/[email protected].{datetime};/// File size or length of a region within a file.@since(version = 0.2.0)@@ -170,6 +170,7 @@ interface types {}/// A directory entry.+ @since(version = 0.2.0)record directory-entry {/// The type of the file referred to by this directory entry.%type: descriptor-type,@@ -181,6 +182,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.2.0)enum error-code {/// Permission denied, similar to `EACCES` in POSIX.access,@@ -573,13 +575,13 @@ interface preopens {@since(version = 0.2.0)world imports {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@since(version = 0.2.0)import types;@since(version = 0.2.0)diff --git a/crates/wasi/src/p2/wit/deps/io.wit b/crates/wasi/src/p2/wit/deps/io.witindex 08ad78e6b7..543cbfc62c 100644--- a/crates/wasi/src/p2/wit/deps/io.wit+++ b/crates/wasi/src/p2/wit/deps/io.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface error {@@ -8,14 +8,14 @@ interface error {/// which provides some human-readable information about the error.////// In the `wasi:io` package, this resource is returned through the- /// `wasi:io/streams/stream-error` type.+ /// `wasi:io/streams.stream-error` type.////// To provide more specific error information, other interfaces may/// offer functions to "downcast" this error into more specific types. For example,/// errors returned from streams derived from filesystem types can be described using/// the filesystem's own error-code type. This is done using the function- /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow<error>`- /// parameter and returns an `option<wasi:filesystem/types/error-code>`.+ /// `wasi:filesystem/types.filesystem-error-code`, which takes a `borrow<error>`+ /// parameter and returns an `option<wasi:filesystem/types.error-code>`.////// The set of functions which can "downcast" an `error` into a more/// concrete type is open.@@ -210,27 +210,13 @@ interface streams {/// Perform a write of up to 4096 bytes, and then flush the stream. Block/// until all of these operations are complete, or an error occurs.///- /// This is a convenience wrapper around the use of `check-write`,- /// `subscribe`, `write`, and `flush`, and is implemented with the- /// following pseudo-code:- ///- /// ```text- /// let pollable = this.subscribe();- /// while !contents.is_empty() {- /// // Wait for the stream to become writable- /// pollable.block();- /// let Ok(n) = this.check-write(); // eliding error handling- /// let len = min(n, contents.len());- /// let (chunk, rest) = contents.split_at(len);- /// this.write(chunk ); // eliding error handling- /// contents = rest;- /// }- /// this.flush();- /// // Wait for completion of `flush`- /// pollable.block();- /// // Check for any errors that arose during `flush`- /// let _ = this.check-write(); // eliding error handling- /// ```+ /// Returns success when all of the contents written are successfully+ /// flushed to output. If an error occurs at any point before all+ /// contents are successfully flushed, that error is returned as soon as+ /// possible. If writing and flushing the complete contents causes the+ /// stream to become closed, this call should return success, and+ /// subsequent calls to check-write or other interfaces should return+ /// stream-error::closed.@since(version = 0.2.0)blocking-write-and-flush: func(contents: list<u8>) -> result<_, stream-error>;/// Request to flush buffered output. This function never blocks.@@ -273,26 +259,8 @@ interface streams {/// Block until all of these operations are complete, or an error/// occurs.///- /// This is a convenience wrapper around the use of `check-write`,- /// `subscribe`, `write-zeroes`, and `flush`, and is implemented with- /// the following pseudo-code:- ///- /// ```text- /// let pollable = this.subscribe();- /// while num_zeroes != 0 {- /// // Wait for the stream to become writable- /// pollable.block();- /// let Ok(n) = this.check-write(); // eliding error handling- /// let len = min(n, num_zeroes);- /// this.write-zeroes(len); // eliding error handling- /// num_zeroes -= len;- /// }- /// this.flush();- /// // Wait for completion of `flush`- /// pollable.block();- /// // Check for any errors that arose during `flush`- /// let _ = this.check-write(); // eliding error handling- /// ```+ /// Functionality is equivelant to `blocking-write-and-flush` with+ /// contents given as a list of len containing only zeroes.@since(version = 0.2.0)blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>;/// Read from one stream and write to another.diff --git a/crates/wasi/src/p2/wit/deps/random.wit b/crates/wasi/src/p2/wit/deps/random.witindex 73edf5b60e..5b4b2522b9 100644--- a/crates/wasi/src/p2/wit/deps/random.wit+++ b/crates/wasi/src/p2/wit/deps/random.wit@@ -1,4 +1,4 @@-package wasi:[email protected];+package wasi:[email protected];/// The insecure-seed interface for seeding hash-map DoS resistance.///diff --git a/crates/wasi/src/p2/wit/deps/sockets.wit b/crates/wasi/src/p2/wit/deps/sockets.witindex db6d1a23b4..1ac69d2dce 100644--- a/crates/wasi/src/p2/wit/deps/sockets.wit+++ b/crates/wasi/src/p2/wit/deps/sockets.wit@@ -1,9 +1,9 @@-package wasi:[email protected];+package wasi:[email protected];@since(version = 0.2.0)interface network {@unstable(feature = network-error-code)- use wasi:io/[email protected].{error};+ use wasi:io/[email protected].{error};/// An opaque resource that represents access to (a subset of) the network./// This enables context-based security for networking.@@ -160,7 +160,7 @@ interface instance-network {@since(version = 0.2.0)interface ip-name-lookup {@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};@since(version = 0.2.0)use network.{network, error-code, ip-address};@@ -216,11 +216,11 @@ interface ip-name-lookup {@since(version = 0.2.0)interface tcp {@since(version = 0.2.0)- use wasi:io/[email protected].{input-stream, output-stream};+ use wasi:io/[email protected].{input-stream, output-stream};@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};@since(version = 0.2.0)- use wasi:clocks/[email protected].{duration};+ use wasi:clocks/[email protected].{duration};@since(version = 0.2.0)use network.{network, error-code, ip-socket-address, ip-address-family};@@ -245,7 +245,7 @@ interface tcp {/// - `connect-in-progress`/// - `connected`/// - `closed`- /// See <https://github.com/WebAssembly/wasi-sockets/blob/main/TcpSocketOperationalSemantics.md>+ /// See <https://github.com/WebAssembly/WASI/blob/main/proposals/sockets/TcpSocketOperationalSemantics.md>/// for more information.////// Note: Except where explicitly mentioned, whenever this documentation uses@@ -548,7 +548,7 @@ interface tcp {/// `subscribe` only has to be called once per socket and can then be/// (re)used for the remainder of the socket's lifetime.///- /// See <https://github.com/WebAssembly/wasi-sockets/blob/main/TcpSocketOperationalSemantics.md#pollable-readiness>+ /// See <https://github.com/WebAssembly/WASI/blob/main/proposals/sockets/TcpSocketOperationalSemantics.md#pollable-readiness>/// for more information.////// Note: this function is here for WASI 0.2 only.@@ -617,7 +617,7 @@ interface tcp-create-socket {@since(version = 0.2.0)interface udp {@since(version = 0.2.0)- use wasi:io/[email protected].{pollable};+ use wasi:io/[email protected].{pollable};@since(version = 0.2.0)use network.{network, error-code, ip-socket-address, ip-address-family};@@ -925,21 +925,21 @@ interface udp-create-socket {@since(version = 0.2.0)world imports {@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import network;@since(version = 0.2.0)import instance-network;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)import udp;@since(version = 0.2.0)import udp-create-socket;@since(version = 0.2.0)- import wasi:io/[email protected];+ import wasi:io/[email protected];@since(version = 0.2.0)- import wasi:clocks/[email protected];+ import wasi:clocks/[email protected];@since(version = 0.2.0)import tcp;@since(version = 0.2.0)diff --git a/crates/wasi/src/p2/wit/test.wit b/crates/wasi/src/p2/wit/test.witindex d0d29618b8..ad0ba189c9 100644--- a/crates/wasi/src/p2/wit/test.wit+++ b/crates/wasi/src/p2/wit/test.wit@@ -1,13 +1,13 @@world test-reactor {- include wasi:cli/[email protected];+ include wasi:cli/[email protected];export add-strings: func(s: list<string>) -> u32;export get-strings: func() -> list<string>;- use wasi:io/[email protected].{output-stream};+ use wasi:io/[email protected].{output-stream};export write-strings-to: func(o: output-stream) -> result;- use wasi:filesystem/[email protected].{descriptor-stat};+ use wasi:filesystem/[email protected].{descriptor-stat};export pass-an-imported-record: func(d: descriptor-stat) -> string;}diff --git a/crates/wasi/src/p2/wit/world.wit b/crates/wasi/src/p2/wit/world.witindex c322caeecb..d2527c5d35 100644--- a/crates/wasi/src/p2/wit/world.wit+++ b/crates/wasi/src/p2/wit/world.wit@@ -2,5 +2,5 @@package wasmtime:wasi;world bindings {- include wasi:cli/[email protected];+ include wasi:cli/[email protected];}diff --git a/examples/min-platform/embedding/src/wasi.rs b/examples/min-platform/embedding/src/wasi.rsindex 96f957f53c..443d63b267 100644--- a/examples/min-platform/embedding/src/wasi.rs+++ b/examples/min-platform/embedding/src/wasi.rs@@ -212,7 +212,7 @@ pub fn add_to_linker_async(linker: &mut Linker<ExampleCtx>) -> Result<()> {wasi::clocks::monotonic_clock::add_to_linker::<_, Data>(linker, |t| t)?;wasi::clocks::wall_clock::add_to_linker::<_, Data>(linker, |t| t)?;wasi::cli::environment::add_to_linker::<_, Data>(linker, |t| t)?;- wasi::cli::exit::add_to_linker::<_, Data>(linker, &Default::default(), |t| t)?;+ wasi::cli::exit::add_to_linker::<_, Data>(linker, |t| t)?;wasi::cli::stdin::add_to_linker::<_, Data>(linker, |t| t)?;wasi::cli::stdout::add_to_linker::<_, Data>(linker, |t| t)?;wasi::cli::stderr::add_to_linker::<_, Data>(linker, |t| t)?;diff --git a/src/common.rs b/src/common.rsindex 4749bdc8b4..204c7cd44d 100644--- a/src/common.rs+++ b/src/common.rs@@ -464,7 +464,9 @@ impl RunCommon {T: wasmtime_wasi::WasiView,{let mut p2_options = wasmtime_wasi::p2::bindings::LinkOptions::default();- p2_options.cli_exit_with_code(self.common.wasi.cli_exit_with_code.unwrap_or(false));+ if self.common.wasi.cli_exit_with_code == Some(false) {+ eprintln!("warning: cannot disable `-Scli-exit-with-code` any more");+ }p2_options.network_error_code(self.common.wasi.network_error_code.unwrap_or(false));wasmtime_wasi::p2::add_to_linker_with_options_async(linker, &p2_options)?;