Skip to content

Commit

Permalink
Merge pull request #39 from WebAssembly/pch/rc-2024-01-16
Browse files Browse the repository at this point in the history
Set release candidate version to 0.2.0-rc-2024-01-16
  • Loading branch information
pchickey authored Jan 16, 2024
2 parents 87b8233 + cdad848 commit a64be9c
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 286 deletions.
172 changes: 54 additions & 118 deletions command.md

Large diffs are not rendered by default.

168 changes: 52 additions & 116 deletions imports.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wit/command.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:cli@0.2.0-rc-2023-12-05;
package wasi:cli@0.2.0-rc-2024-01-16;

world command {
include imports;
Expand Down
4 changes: 2 additions & 2 deletions wit/deps.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ sha512 = "cc4fa3d178559a89d9d6a376e3359b892158d1e73317c5db1f797ebc6b0b57abf24227

[sockets]
url = "https://github.com/WebAssembly/wasi-sockets/archive/main.tar.gz"
sha256 = "8bcfc6838515714d4bd6cbfb81bb2dd25c6d509c34d593fe6398a08ae825a0be"
sha512 = "85d23ff1478cd2bee5023c11ed75edaa918f14ad3f0d1142de88b3145a25189c40f4194421f1e234cc893091255c68e5b157e16682bcc5ae0993f78bed606504"
sha256 = "40863017f355ac90c57630cc00b94518804e8e2c5694a7870b7a54dbdcda0e08"
sha512 = "2d6a919247430e869bf85a06a6a1d198f04368951e76c1fec7961b2b07af381c58c8e8b9079c91925dfbf80976971213329be57d59a90bae6e4e6460b073dc88"
3 changes: 2 additions & 1 deletion wit/deps/sockets/tcp-create-socket.wit
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ interface tcp-create-socket {
/// Create a new TCP socket.
///
/// Similar to `socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP)` in POSIX.
/// On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.
///
/// This function does not require a network capability handle. This is considered to be safe because
/// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`listen`/`connect`
/// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`connect`
/// is called, the socket is effectively an in-memory configuration object, unable to communicate with the outside world.
///
/// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations.
Expand Down
46 changes: 14 additions & 32 deletions wit/deps/sockets/tcp.wit
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ interface tcp {
/// network interface(s) to bind to.
/// If the TCP/UDP port is zero, the socket will be bound to a random free port.
///
/// When a socket is not explicitly bound, the first invocation to a listen or connect operation will
/// implicitly bind the socket.
///
/// Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts.
///
/// # Typical `start` errors
/// - `invalid-argument`: The `local-address` has the wrong address family. (EAFNOSUPPORT, EFAULT on Windows)
/// - `invalid-argument`: `local-address` is not a unicast address. (EINVAL)
/// - `invalid-argument`: `local-address` is an IPv4-mapped IPv6 address, but the socket has `ipv6-only` enabled. (EINVAL)
/// - `invalid-argument`: `local-address` is an IPv4-mapped IPv6 address. (EINVAL)
/// - `invalid-state`: The socket is already bound. (EINVAL)
///
/// # Typical `finish` errors
Expand Down Expand Up @@ -63,20 +60,13 @@ interface tcp {
/// - the socket is transitioned into the Connection state
/// - a pair of streams is returned that can be used to read & write to the connection
///
/// POSIX mentions:
/// > If connect() fails, the state of the socket is unspecified. Conforming applications should
/// > close the file descriptor and create a new socket before attempting to reconnect.
///
/// WASI prescribes the following behavior:
/// - If `connect` fails because an input/state validation error, the socket should remain usable.
/// - If a connection was actually attempted but failed, the socket should become unusable for further network communication.
/// Besides `drop`, any method after such a failure may return an error.
/// After a failed connection attempt, the only valid action left is to
/// `drop` the socket. A single socket can not be used to connect more than once.
///
/// # Typical `start` errors
/// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT)
/// - `invalid-argument`: `remote-address` is not a unicast address. (EINVAL, ENETUNREACH on Linux, EAFNOSUPPORT on MacOS)
/// - `invalid-argument`: `remote-address` is an IPv4-mapped IPv6 address, but the socket has `ipv6-only` enabled. (EINVAL, EADDRNOTAVAIL on Illumos)
/// - `invalid-argument`: `remote-address` is a non-IPv4-mapped IPv6 address, but the socket was bound to a specific IPv4-mapped IPv6 address. (or vice versa)
/// - `invalid-argument`: `remote-address` is an IPv4-mapped IPv6 address. (EINVAL, EADDRNOTAVAIL on Illumos)
/// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EADDRNOTAVAIL on Windows)
/// - `invalid-argument`: The port in `remote-address` is set to 0. (EADDRNOTAVAIL on Windows)
/// - `invalid-argument`: The socket is already attached to a different network. The `network` passed to `connect` must be identical to the one passed to `bind`.
Expand Down Expand Up @@ -131,7 +121,6 @@ interface tcp {
///
/// The returned socket is bound and in the Connection state. The following properties are inherited from the listener socket:
/// - `address-family`
/// - `ipv6-only`
/// - `keep-alive-enabled`
/// - `keep-alive-idle-time`
/// - `keep-alive-interval`
Expand Down Expand Up @@ -196,17 +185,6 @@ interface tcp {
/// Equivalent to the SO_DOMAIN socket option.
address-family: func() -> ip-address-family;

/// Whether IPv4 compatibility (dual-stack) mode is disabled or not.
///
/// Equivalent to the IPV6_V6ONLY socket option.
///
/// # Typical errors
/// - `invalid-state`: (set) The socket is already bound.
/// - `not-supported`: (get/set) `this` socket is an IPv4 socket.
/// - `not-supported`: (set) Host does not support dual-stack sockets. (Implementations are not required to.)
ipv6-only: func() -> result<bool, error-code>;
set-ipv6-only: func(value: bool) -> result<_, error-code>;

/// Hints the desired listen queue size. Implementations are free to ignore this.
///
/// If the provided value is 0, an `invalid-argument` error is returned.
Expand Down Expand Up @@ -305,12 +283,16 @@ interface tcp {

/// Initiate a graceful shutdown.
///
/// - receive: the socket is not expecting to receive any more data from the peer. All subsequent read
/// operations on the `input-stream` associated with this socket will return an End Of Stream indication.
/// Any data still in the receive queue at time of calling `shutdown` will be discarded.
/// - send: the socket is not expecting to send any more data to the peer. All subsequent write
/// operations on the `output-stream` associated with this socket will return an error.
/// - both: same effect as receive & send combined.
/// - `receive`: The socket is not expecting to receive any data from
/// the peer. The `input-stream` associated with this socket will be
/// closed. Any data still in the receive queue at time of calling
/// this method will be discarded.
/// - `send`: The socket has no more data to send to the peer. The `output-stream`
/// associated with this socket will be closed and a FIN packet will be sent.
/// - `both`: Same effect as `receive` & `send` combined.
///
/// This function is idempotent. Shutting a down a direction more than once
/// has no effect and returns `ok`.
///
/// The shutdown function does not close (drop) the socket.
///
Expand Down
1 change: 1 addition & 0 deletions wit/deps/sockets/udp-create-socket.wit
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface udp-create-socket {
/// Create a new UDP socket.
///
/// Similar to `socket(AF_INET or AF_INET6, SOCK_DGRAM, IPPROTO_UDP)` in POSIX.
/// On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.
///
/// This function does not require a network capability handle. This is considered to be safe because
/// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind` is called,
Expand Down
13 changes: 0 additions & 13 deletions wit/deps/sockets/udp.wit
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ interface udp {
///
/// # Typical errors
/// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT)
/// - `invalid-argument`: `remote-address` is a non-IPv4-mapped IPv6 address, but the socket was bound to a specific IPv4-mapped IPv6 address. (or vice versa)
/// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL)
/// - `invalid-argument`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL)
/// - `invalid-state`: The socket is not bound.
Expand Down Expand Up @@ -142,17 +141,6 @@ interface udp {
/// Equivalent to the SO_DOMAIN socket option.
address-family: func() -> ip-address-family;

/// Whether IPv4 compatibility (dual-stack) mode is disabled or not.
///
/// Equivalent to the IPV6_V6ONLY socket option.
///
/// # Typical errors
/// - `not-supported`: (get/set) `this` socket is an IPv4 socket.
/// - `invalid-state`: (set) The socket is already bound.
/// - `not-supported`: (set) Host does not support dual-stack sockets. (Implementations are not required to.)
ipv6-only: func() -> result<bool, error-code>;
set-ipv6-only: func(value: bool) -> result<_, error-code>;

/// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options.
///
/// If the provided value is 0, an `invalid-argument` error is returned.
Expand Down Expand Up @@ -248,7 +236,6 @@ interface udp {
///
/// # Typical errors
/// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT)
/// - `invalid-argument`: `remote-address` is a non-IPv4-mapped IPv6 address, but the socket was bound to a specific IPv4-mapped IPv6 address. (or vice versa)
/// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL)
/// - `invalid-argument`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL)
/// - `invalid-argument`: The socket is in "connected" mode and `remote-address` is `some` value that does not match the address passed to `stream`. (EISCONN)
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/sockets/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:sockets@0.2.0-rc-2023-11-10;
package wasi:sockets@0.2.0-rc-2024-01-16;

world imports {
import instance-network;
Expand Down
4 changes: 2 additions & 2 deletions wit/imports.wit
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package wasi:cli@0.2.0-rc-2023-12-05;
package wasi:cli@0.2.0-rc-2024-01-16;

world imports {
include wasi:clocks/imports@0.2.0-rc-2023-11-10;
include wasi:filesystem/imports@0.2.0-rc-2023-11-10;
include wasi:sockets/imports@0.2.0-rc-2023-11-10;
include wasi:sockets/imports@0.2.0-rc-2024-01-16;
include wasi:random/imports@0.2.0-rc-2023-11-10;
include wasi:io/imports@0.2.0-rc-2023-11-10;

Expand Down

0 comments on commit a64be9c

Please sign in to comment.