diff --git a/wasip2/README.md b/wasip2/README.md index c30591070..795c34d01 100644 --- a/wasip2/README.md +++ b/wasip2/README.md @@ -20,13 +20,13 @@ WASI Preview 2 contains the following APIs: | Proposal | Version | |-------------------|---------| -| [wasi-io] | 0.2.6 | -| [wasi-clocks] | 0.2.6 | -| [wasi-random] | 0.2.6 | -| [wasi-filesystem] | 0.2.6 | -| [wasi-sockets] | 0.2.6 | -| [wasi-cli] | 0.2.6 | -| [wasi-http] | 0.2.6 | +| [wasi-io] | 0.2.7 | +| [wasi-clocks] | 0.2.7 | +| [wasi-random] | 0.2.7 | +| [wasi-filesystem] | 0.2.7 | +| [wasi-sockets] | 0.2.7 | +| [wasi-cli] | 0.2.7 | +| [wasi-http] | 0.2.7 | [wasi-io]: https://github.com/WebAssembly/wasi-io [wasi-clocks]: https://github.com/WebAssembly/wasi-clocks diff --git a/wasip2/cli/command.wit b/wasip2/cli/command.wit index 6d3cc83f5..dfecf913e 100644 --- a/wasip2/cli/command.wit +++ b/wasip2/cli/command.wit @@ -1,4 +1,4 @@ -package wasi:cli@0.2.6; +package wasi:cli@0.2.7; @since(version = 0.2.0) world command { diff --git a/wasip2/cli/imports.wit b/wasip2/cli/imports.wit index d9fd01710..e7f7942de 100644 --- a/wasip2/cli/imports.wit +++ b/wasip2/cli/imports.wit @@ -1,17 +1,17 @@ -package wasi:cli@0.2.6; +package wasi:cli@0.2.7; @since(version = 0.2.0) world imports { @since(version = 0.2.0) - include wasi:clocks/imports@0.2.6; + include wasi:clocks/imports@0.2.7; @since(version = 0.2.0) - include wasi:filesystem/imports@0.2.6; + include wasi:filesystem/imports@0.2.7; @since(version = 0.2.0) - include wasi:sockets/imports@0.2.6; + include wasi:sockets/imports@0.2.7; @since(version = 0.2.0) - include wasi:random/imports@0.2.6; + include wasi:random/imports@0.2.7; @since(version = 0.2.0) - include wasi:io/imports@0.2.6; + include wasi:io/imports@0.2.7; @since(version = 0.2.0) import environment; diff --git a/wasip2/cli/stdio.wit b/wasip2/cli/stdio.wit index cb8aea2d9..1c3c6d074 100644 --- a/wasip2/cli/stdio.wit +++ b/wasip2/cli/stdio.wit @@ -1,7 +1,7 @@ @since(version = 0.2.0) interface stdin { @since(version = 0.2.0) - use wasi:io/streams@0.2.6.{input-stream}; + use wasi:io/streams@0.2.7.{input-stream}; @since(version = 0.2.0) get-stdin: func() -> input-stream; @@ -10,7 +10,7 @@ interface stdin { @since(version = 0.2.0) interface stdout { @since(version = 0.2.0) - use wasi:io/streams@0.2.6.{output-stream}; + use wasi:io/streams@0.2.7.{output-stream}; @since(version = 0.2.0) get-stdout: func() -> output-stream; @@ -19,7 +19,7 @@ interface stdout { @since(version = 0.2.0) interface stderr { @since(version = 0.2.0) - use wasi:io/streams@0.2.6.{output-stream}; + use wasi:io/streams@0.2.7.{output-stream}; @since(version = 0.2.0) get-stderr: func() -> output-stream; diff --git a/wasip2/clocks/monotonic-clock.wit b/wasip2/clocks/monotonic-clock.wit index f3bc83912..98a9ad42a 100644 --- a/wasip2/clocks/monotonic-clock.wit +++ b/wasip2/clocks/monotonic-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.7; /// WASI Monotonic Clock is a clock API intended to let users measure elapsed /// time. /// @@ -10,7 +10,7 @@ package wasi:clocks@0.2.6; @since(version = 0.2.0) interface monotonic-clock { @since(version = 0.2.0) - use wasi:io/poll@0.2.6.{pollable}; + use wasi:io/poll@0.2.7.{pollable}; /// An instant in time, in nanoseconds. An instant is relative to an /// unspecified initial value, and can only be compared to instances from diff --git a/wasip2/clocks/timezone.wit b/wasip2/clocks/timezone.wit index ca98ad152..4740bde00 100644 --- a/wasip2/clocks/timezone.wit +++ b/wasip2/clocks/timezone.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.7; @unstable(feature = clocks-timezone) interface timezone { diff --git a/wasip2/clocks/wall-clock.wit b/wasip2/clocks/wall-clock.wit index 76636a0c9..2179b6c56 100644 --- a/wasip2/clocks/wall-clock.wit +++ b/wasip2/clocks/wall-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.7; /// WASI Wall Clock is a clock API intended to let users query the current /// time. The name "wall" makes an analogy to a "clock on the wall", which /// is not necessarily monotonic as it may be reset. diff --git a/wasip2/clocks/world.wit b/wasip2/clocks/world.wit index 5c53c51a1..a08ff2c2c 100644 --- a/wasip2/clocks/world.wit +++ b/wasip2/clocks/world.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.7; @since(version = 0.2.0) world imports { diff --git a/wasip2/filesystem/preopens.wit b/wasip2/filesystem/preopens.wit index f22847940..b1a0a9972 100644 --- a/wasip2/filesystem/preopens.wit +++ b/wasip2/filesystem/preopens.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.6; +package wasi:filesystem@0.2.7; @since(version = 0.2.0) interface preopens { diff --git a/wasip2/filesystem/types.wit b/wasip2/filesystem/types.wit index 75c19044c..a7da2b72f 100644 --- a/wasip2/filesystem/types.wit +++ b/wasip2/filesystem/types.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.6; +package wasi:filesystem@0.2.7; /// WASI filesystem is a filesystem API primarily intended to let users run WASI /// programs that access their files on their existing filesystems, without /// significant overhead. @@ -26,9 +26,9 @@ package wasi:filesystem@0.2.6; @since(version = 0.2.0) interface types { @since(version = 0.2.0) - use wasi:io/streams@0.2.6.{input-stream, output-stream, error}; + use wasi:io/streams@0.2.7.{input-stream, output-stream, error}; @since(version = 0.2.0) - use wasi:clocks/wall-clock@0.2.6.{datetime}; + use wasi:clocks/wall-clock@0.2.7.{datetime}; /// File size or length of a region within a file. @since(version = 0.2.0) diff --git a/wasip2/filesystem/world.wit b/wasip2/filesystem/world.wit index 65597f9f2..67309b43f 100644 --- a/wasip2/filesystem/world.wit +++ b/wasip2/filesystem/world.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.6; +package wasi:filesystem@0.2.7; @since(version = 0.2.0) world imports { diff --git a/wasip2/http/proxy.wit b/wasip2/http/proxy.wit index 5bd9f9989..b503ea795 100644 --- a/wasip2/http/proxy.wit +++ b/wasip2/http/proxy.wit @@ -1,4 +1,4 @@ -package wasi:http@0.2.6; +package wasi:http@0.2.7; /// The `wasi:http/imports` world imports all the APIs for HTTP proxies. /// It is intended to be `include`d in other worlds. @@ -6,25 +6,25 @@ package wasi:http@0.2.6; world imports { /// HTTP proxies have access to time and randomness. @since(version = 0.2.0) - import wasi:clocks/monotonic-clock@0.2.6; + import wasi:clocks/monotonic-clock@0.2.7; @since(version = 0.2.0) - import wasi:clocks/wall-clock@0.2.6; + import wasi:clocks/wall-clock@0.2.7; @since(version = 0.2.0) - import wasi:random/random@0.2.6; + import wasi:random/random@0.2.7; /// Proxies have standard output and error streams which are expected to /// terminate in a developer-facing console provided by the host. @since(version = 0.2.0) - import wasi:cli/stdout@0.2.6; + import wasi:cli/stdout@0.2.7; @since(version = 0.2.0) - import wasi:cli/stderr@0.2.6; + import wasi:cli/stderr@0.2.7; /// TODO: this is a temporary workaround until component tooling is able to /// gracefully handle the absence of stdin. Hosts must return an eof stream /// for this import, which is what wasi-libc + tooling will do automatically /// when this import is properly removed. @since(version = 0.2.0) - import wasi:cli/stdin@0.2.6; + import wasi:cli/stdin@0.2.7; /// This is the default handler to use when user code simply wants to make an /// HTTP request (e.g., via `fetch()`). diff --git a/wasip2/http/types.wit b/wasip2/http/types.wit index c9f3cc4b9..9ebff8b50 100644 --- a/wasip2/http/types.wit +++ b/wasip2/http/types.wit @@ -4,13 +4,13 @@ @since(version = 0.2.0) interface types { @since(version = 0.2.0) - use wasi:clocks/monotonic-clock@0.2.6.{duration}; + use wasi:clocks/monotonic-clock@0.2.7.{duration}; @since(version = 0.2.0) - use wasi:io/streams@0.2.6.{input-stream, output-stream}; + use wasi:io/streams@0.2.7.{input-stream, output-stream}; @since(version = 0.2.0) - use wasi:io/error@0.2.6.{error as io-error}; + use wasi:io/error@0.2.7.{error as io-error}; @since(version = 0.2.0) - use wasi:io/poll@0.2.6.{pollable}; + use wasi:io/poll@0.2.7.{pollable}; /// This type corresponds to HTTP standard Methods. @since(version = 0.2.0) diff --git a/wasip2/io/error.wit b/wasip2/io/error.wit index 784f74a53..acab3a811 100644 --- a/wasip2/io/error.wit +++ b/wasip2/io/error.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.7; @since(version = 0.2.0) interface error { diff --git a/wasip2/io/poll.wit b/wasip2/io/poll.wit index 7f711836c..a525164b9 100644 --- a/wasip2/io/poll.wit +++ b/wasip2/io/poll.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.7; /// A poll API intended to let users wait for I/O events on multiple handles /// at once. diff --git a/wasip2/io/streams.wit b/wasip2/io/streams.wit index c5da38c86..7ae29a3cd 100644 --- a/wasip2/io/streams.wit +++ b/wasip2/io/streams.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.7; /// WASI I/O is an I/O abstraction API which is currently focused on providing /// stream types. @@ -154,27 +154,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 @@ -227,26 +213,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( /// The number of zero-bytes to write diff --git a/wasip2/io/world.wit b/wasip2/io/world.wit index 84c85c08e..73b1a6df5 100644 --- a/wasip2/io/world.wit +++ b/wasip2/io/world.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.7; @since(version = 0.2.0) world imports { diff --git a/wasip2/random/insecure-seed.wit b/wasip2/random/insecure-seed.wit index d3dc03a6c..0209b84b0 100644 --- a/wasip2/random/insecure-seed.wit +++ b/wasip2/random/insecure-seed.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.7; /// The insecure-seed interface for seeding hash-map DoS resistance. /// /// It is intended to be portable at least between Unix-family platforms and diff --git a/wasip2/random/insecure.wit b/wasip2/random/insecure.wit index d4d028480..820d069ee 100644 --- a/wasip2/random/insecure.wit +++ b/wasip2/random/insecure.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.7; /// The insecure interface for insecure pseudo-random numbers. /// /// It is intended to be portable at least between Unix-family platforms and diff --git a/wasip2/random/random.wit b/wasip2/random/random.wit index a0ff95646..974ab465d 100644 --- a/wasip2/random/random.wit +++ b/wasip2/random/random.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.7; /// WASI Random is a random data API. /// /// It is intended to be portable at least between Unix-family platforms and diff --git a/wasip2/random/world.wit b/wasip2/random/world.wit index 099f47b36..333b42598 100644 --- a/wasip2/random/world.wit +++ b/wasip2/random/world.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.7; @since(version = 0.2.0) world imports { diff --git a/wasip2/sockets/ip-name-lookup.wit b/wasip2/sockets/ip-name-lookup.wit index ee6419e7d..df2735aac 100644 --- a/wasip2/sockets/ip-name-lookup.wit +++ b/wasip2/sockets/ip-name-lookup.wit @@ -1,7 +1,7 @@ @since(version = 0.2.0) interface ip-name-lookup { @since(version = 0.2.0) - use wasi:io/poll@0.2.6.{pollable}; + use wasi:io/poll@0.2.7.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-address}; diff --git a/wasip2/sockets/network.wit b/wasip2/sockets/network.wit index 6ca98b63b..95df71ff3 100644 --- a/wasip2/sockets/network.wit +++ b/wasip2/sockets/network.wit @@ -1,7 +1,7 @@ @since(version = 0.2.0) interface network { @unstable(feature = network-error-code) - use wasi:io/error@0.2.6.{error}; + use wasi:io/error@0.2.7.{error}; /// An opaque resource that represents access to (a subset of) the network. /// This enables context-based security for networking. diff --git a/wasip2/sockets/tcp.wit b/wasip2/sockets/tcp.wit index beefd7b46..104d9aa39 100644 --- a/wasip2/sockets/tcp.wit +++ b/wasip2/sockets/tcp.wit @@ -1,11 +1,11 @@ @since(version = 0.2.0) interface tcp { @since(version = 0.2.0) - use wasi:io/streams@0.2.6.{input-stream, output-stream}; + use wasi:io/streams@0.2.7.{input-stream, output-stream}; @since(version = 0.2.0) - use wasi:io/poll@0.2.6.{pollable}; + use wasi:io/poll@0.2.7.{pollable}; @since(version = 0.2.0) - use wasi:clocks/monotonic-clock@0.2.6.{duration}; + use wasi:clocks/monotonic-clock@0.2.7.{duration}; @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; diff --git a/wasip2/sockets/udp.wit b/wasip2/sockets/udp.wit index 9dbe6932d..ecf2dfe60 100644 --- a/wasip2/sockets/udp.wit +++ b/wasip2/sockets/udp.wit @@ -1,7 +1,7 @@ @since(version = 0.2.0) interface udp { @since(version = 0.2.0) - use wasi:io/poll@0.2.6.{pollable}; + use wasi:io/poll@0.2.7.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; diff --git a/wasip2/sockets/world.wit b/wasip2/sockets/world.wit index e86f02cec..9a4d317f7 100644 --- a/wasip2/sockets/world.wit +++ b/wasip2/sockets/world.wit @@ -1,4 +1,4 @@ -package wasi:sockets@0.2.6; +package wasi:sockets@0.2.7; @since(version = 0.2.0) world imports {