Skip to content

Commit ac94700

Browse files
committed
wit-deps update
1 parent 7a0889a commit ac94700

File tree

11 files changed

+71
-83
lines changed

11 files changed

+71
-83
lines changed

wit/deps.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[cli]
22
url = "https://github.com/WebAssembly/wasi-cli/archive/main.tar.gz"
3-
sha256 = "6894203a2ac50a68f6b91f2174826c2987cc0efc94ad1f8f14f8460e262fc103"
4-
sha512 = "349776db1b1455e176ca61a1a8ec653f77b888d291e948feded3b6b46350c65973e9e75cc0bf8649256654001af2408eacc585c31454008c86ff53b301da5c32"
3+
sha256 = "754f9d1de112e106cc7131b79b1efd29340f9d6191699f224835fd41521ba386"
4+
sha512 = "908a67492c05f752b0152646e5acdccdde89d8b303db254bf462d2e6714c420d80ebebc46ab75b8953c060a06ea06d99d55b523f6aa09e2f4f16d5e63649f0ea"
55

66
[clocks]
77
url = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz"
@@ -15,8 +15,8 @@ sha512 = "2c242489801a75466986fe014d730fb3aa7b5c6e56a230c8735e6672711b58bcbe92ba
1515

1616
[io]
1717
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
18-
sha256 = "b622db2755978a49d18d35d84d75f66b2b1ed23d7bf413e5c9e152e190cc7d4b"
19-
sha512 = "d19c9004e75bf3ebe3e34cff498c3d7fee04cd57a7fba7ed12a0c5ad842ba5715c009de77a152c57da0500f6ca0986b6791b6f022829bdd5a024f7bc114c2ff6"
18+
sha256 = "7a3c644dfd434f77fdf3f3d3b3caaca9538a0ade785167a3cce0321609f9d4e1"
19+
sha512 = "2888f12b91359d630b4270f60e3c78855d9b305274ebf8a5decaef8698a74cc85c426823dc708b393f461b85ad991711d7400c2b2a24795001db5aee3ae19c70"
2020

2121
[random]
2222
url = "https://github.com/WebAssembly/wasi-random/archive/main.tar.gz"
@@ -25,5 +25,5 @@ sha512 = "cc4fa3d178559a89d9d6a376e3359b892158d1e73317c5db1f797ebc6b0b57abf24227
2525

2626
[sockets]
2727
url = "https://github.com/WebAssembly/wasi-sockets/archive/main.tar.gz"
28-
sha256 = "b5c2e9cc87cefbaef06bbe9978f9bc336da9feee2d51747bc28e10164fc46c39"
29-
sha512 = "3aea6fe0c768b27d5c5cb3adab5e60dc936198f8b677c2cf6c4d57a0460db87eb779e0b577f1240fb2a6bf3ade49919fbffe39b0137bce3242343e6091cc7510"
28+
sha256 = "40863017f355ac90c57630cc00b94518804e8e2c5694a7870b7a54dbdcda0e08"
29+
sha512 = "2d6a919247430e869bf85a06a6a1d198f04368951e76c1fec7961b2b07af381c58c8e8b9079c91925dfbf80976971213329be57d59a90bae6e4e6460b073dc88"

wit/deps/cli/command.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:cli@0.2.0-rc-2023-12-05;
1+
package wasi:cli@0.2.0-rc-2024-01-16;
22

33
world command {
44
include imports;

wit/deps/cli/imports.wit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package wasi:cli@0.2.0-rc-2023-12-05;
1+
package wasi:cli@0.2.0-rc-2024-01-16;
22

33
world imports {
44
include wasi:clocks/imports@0.2.0-rc-2023-11-10;
55
include wasi:filesystem/imports@0.2.0-rc-2023-11-10;
6-
include wasi:sockets/imports@0.2.0-rc-2023-11-10;
6+
include wasi:sockets/imports@0.2.0-rc-2024-01-16;
77
include wasi:random/imports@0.2.0-rc-2023-11-10;
88
include wasi:io/imports@0.2.0-rc-2023-11-10;
99

wit/deps/cli/terminal.wit

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1+
/// Terminal input.
2+
///
3+
/// In the future, this may include functions for disabling echoing,
4+
/// disabling input buffering so that keyboard events are sent through
5+
/// immediately, querying supported features, and so on.
16
interface terminal-input {
27
/// The input side of a terminal.
38
resource terminal-input;
4-
5-
// In the future, this may include functions for disabling echoing,
6-
// disabling input buffering so that keyboard events are sent through
7-
// immediately, querying supported features, and so on.
89
}
910

11+
/// Terminal output.
12+
///
13+
/// In the future, this may include functions for querying the terminal
14+
/// size, being notified of terminal size changes, querying supported
15+
/// features, and so on.
1016
interface terminal-output {
1117
/// The output side of a terminal.
1218
resource terminal-output;
13-
14-
// In the future, this may include functions for querying the terminal
15-
// size, being notified of terminal size changes, querying supported
16-
// features, and so on.
1719
}
1820

1921
/// An interface providing an optional `terminal-input` for stdin as a

wit/deps/io/streams.wit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ interface streams {
3232
resource input-stream {
3333
/// Perform a non-blocking read from the stream.
3434
///
35+
/// When the source of a `read` is binary data, the bytes from the source
36+
/// are returned verbatim. When the source of a `read` is known to the
37+
/// implementation to be text, bytes containing the UTF-8 encoding of the
38+
/// text are returned.
39+
///
3540
/// This function returns a list of bytes containing the read data,
3641
/// when successful. The returned list will contain up to `len` bytes;
3742
/// it may return fewer than requested, but not more. The list is
@@ -111,6 +116,12 @@ interface streams {
111116

112117
/// Perform a write. This function never blocks.
113118
///
119+
/// When the destination of a `write` is binary data, the bytes from
120+
/// `contents` are written verbatim. When the destination of a `write` is
121+
/// known to the implementation to be text, the bytes of `contents` are
122+
/// transcoded from UTF-8 into the encoding of the destination and then
123+
/// written.
124+
///
114125
/// Precondition: check-write gave permit of Ok(n) and contents has a
115126
/// length of less than or equal to n. Otherwise, this function will trap.
116127
///

wit/deps/sockets/network.wit

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ interface network {
1818
///
1919
/// See each individual API for what the POSIX equivalents are. They sometimes differ per API.
2020
enum error-code {
21-
// ### GENERAL ERRORS ###
22-
2321
/// Unknown error
2422
unknown,
2523

@@ -64,9 +62,6 @@ interface network {
6462
would-block,
6563

6664

67-
68-
// ### TCP & UDP SOCKET ERRORS ###
69-
7065
/// The operation is not valid in the socket's current state.
7166
invalid-state,
7267

@@ -83,24 +78,21 @@ interface network {
8378
remote-unreachable,
8479

8580

86-
// ### TCP SOCKET ERRORS ###
87-
88-
/// The connection was forcefully rejected
81+
/// The TCP connection was forcefully rejected
8982
connection-refused,
9083

91-
/// The connection was reset.
84+
/// The TCP connection was reset.
9285
connection-reset,
9386

94-
/// A connection was aborted.
87+
/// A TCP connection was aborted.
9588
connection-aborted,
9689

9790

98-
// ### UDP SOCKET ERRORS ###
91+
/// The size of a datagram sent to a UDP socket exceeded the maximum
92+
/// supported size.
9993
datagram-too-large,
10094

10195

102-
// ### NAME LOOKUP ERRORS ###
103-
10496
/// Name does not exist or has no suitable associated IP addresses.
10597
name-unresolvable,
10698

@@ -128,15 +120,21 @@ interface network {
128120
}
129121

130122
record ipv4-socket-address {
131-
port: u16, // sin_port
132-
address: ipv4-address, // sin_addr
123+
/// sin_port
124+
port: u16,
125+
/// sin_addr
126+
address: ipv4-address,
133127
}
134128

135129
record ipv6-socket-address {
136-
port: u16, // sin6_port
137-
flow-info: u32, // sin6_flowinfo
138-
address: ipv6-address, // sin6_addr
139-
scope-id: u32, // sin6_scope_id
130+
/// sin6_port
131+
port: u16,
132+
/// sin6_flowinfo
133+
flow-info: u32,
134+
/// sin6_addr
135+
address: ipv6-address,
136+
/// sin6_scope_id
137+
scope-id: u32,
140138
}
141139

142140
variant ip-socket-address {

wit/deps/sockets/tcp-create-socket.wit

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ interface tcp-create-socket {
66
/// Create a new TCP socket.
77
///
88
/// Similar to `socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP)` in POSIX.
9+
/// On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.
910
///
1011
/// This function does not require a network capability handle. This is considered to be safe because
11-
/// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`listen`/`connect`
12+
/// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`connect`
1213
/// is called, the socket is effectively an in-memory configuration object, unable to communicate with the outside world.
1314
///
1415
/// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations.

wit/deps/sockets/tcp.wit

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@ interface tcp {
2525
/// network interface(s) to bind to.
2626
/// If the TCP/UDP port is zero, the socket will be bound to a random free port.
2727
///
28-
/// When a socket is not explicitly bound, the first invocation to a listen or connect operation will
29-
/// implicitly bind the socket.
30-
///
3128
/// Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts.
3229
///
3330
/// # Typical `start` errors
3431
/// - `invalid-argument`: The `local-address` has the wrong address family. (EAFNOSUPPORT, EFAULT on Windows)
3532
/// - `invalid-argument`: `local-address` is not a unicast address. (EINVAL)
36-
/// - `invalid-argument`: `local-address` is an IPv4-mapped IPv6 address, but the socket has `ipv6-only` enabled. (EINVAL)
33+
/// - `invalid-argument`: `local-address` is an IPv4-mapped IPv6 address. (EINVAL)
3734
/// - `invalid-state`: The socket is already bound. (EINVAL)
3835
///
3936
/// # Typical `finish` errors
@@ -42,6 +39,12 @@ interface tcp {
4239
/// - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL)
4340
/// - `not-in-progress`: A `bind` operation is not in progress.
4441
/// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN)
42+
///
43+
/// # Implementors note
44+
/// When binding to a non-zero port, this bind operation shouldn't be affected by the TIME_WAIT
45+
/// state of a recently closed socket on the same local address. In practice this means that the SO_REUSEADDR
46+
/// socket option should be set implicitly on all platforms, except on Windows where this is the default behavior
47+
/// and SO_REUSEADDR performs something different entirely.
4548
///
4649
/// # References
4750
/// - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html>
@@ -57,20 +60,13 @@ interface tcp {
5760
/// - the socket is transitioned into the Connection state
5861
/// - a pair of streams is returned that can be used to read & write to the connection
5962
///
60-
/// POSIX mentions:
61-
/// > If connect() fails, the state of the socket is unspecified. Conforming applications should
62-
/// > close the file descriptor and create a new socket before attempting to reconnect.
63-
///
64-
/// WASI prescribes the following behavior:
65-
/// - If `connect` fails because an input/state validation error, the socket should remain usable.
66-
/// - If a connection was actually attempted but failed, the socket should become unusable for further network communication.
67-
/// Besides `drop`, any method after such a failure may return an error.
63+
/// After a failed connection attempt, the only valid action left is to
64+
/// `drop` the socket. A single socket can not be used to connect more than once.
6865
///
6966
/// # Typical `start` errors
7067
/// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT)
7168
/// - `invalid-argument`: `remote-address` is not a unicast address. (EINVAL, ENETUNREACH on Linux, EAFNOSUPPORT on MacOS)
72-
/// - `invalid-argument`: `remote-address` is an IPv4-mapped IPv6 address, but the socket has `ipv6-only` enabled. (EINVAL, EADDRNOTAVAIL on Illumos)
73-
/// - `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)
69+
/// - `invalid-argument`: `remote-address` is an IPv4-mapped IPv6 address. (EINVAL, EADDRNOTAVAIL on Illumos)
7470
/// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EADDRNOTAVAIL on Windows)
7571
/// - `invalid-argument`: The port in `remote-address` is set to 0. (EADDRNOTAVAIL on Windows)
7672
/// - `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`.
@@ -125,7 +121,6 @@ interface tcp {
125121
///
126122
/// The returned socket is bound and in the Connection state. The following properties are inherited from the listener socket:
127123
/// - `address-family`
128-
/// - `ipv6-only`
129124
/// - `keep-alive-enabled`
130125
/// - `keep-alive-idle-time`
131126
/// - `keep-alive-interval`
@@ -190,17 +185,6 @@ interface tcp {
190185
/// Equivalent to the SO_DOMAIN socket option.
191186
address-family: func() -> ip-address-family;
192187

193-
/// Whether IPv4 compatibility (dual-stack) mode is disabled or not.
194-
///
195-
/// Equivalent to the IPV6_V6ONLY socket option.
196-
///
197-
/// # Typical errors
198-
/// - `invalid-state`: (set) The socket is already bound.
199-
/// - `not-supported`: (get/set) `this` socket is an IPv4 socket.
200-
/// - `not-supported`: (set) Host does not support dual-stack sockets. (Implementations are not required to.)
201-
ipv6-only: func() -> result<bool, error-code>;
202-
set-ipv6-only: func(value: bool) -> result<_, error-code>;
203-
204188
/// Hints the desired listen queue size. Implementations are free to ignore this.
205189
///
206190
/// If the provided value is 0, an `invalid-argument` error is returned.
@@ -299,12 +283,16 @@ interface tcp {
299283

300284
/// Initiate a graceful shutdown.
301285
///
302-
/// - receive: the socket is not expecting to receive any more data from the peer. All subsequent read
303-
/// operations on the `input-stream` associated with this socket will return an End Of Stream indication.
304-
/// Any data still in the receive queue at time of calling `shutdown` will be discarded.
305-
/// - send: the socket is not expecting to send any more data to the peer. All subsequent write
306-
/// operations on the `output-stream` associated with this socket will return an error.
307-
/// - both: same effect as receive & send combined.
286+
/// - `receive`: The socket is not expecting to receive any data from
287+
/// the peer. The `input-stream` associated with this socket will be
288+
/// closed. Any data still in the receive queue at time of calling
289+
/// this method will be discarded.
290+
/// - `send`: The socket has no more data to send to the peer. The `output-stream`
291+
/// associated with this socket will be closed and a FIN packet will be sent.
292+
/// - `both`: Same effect as `receive` & `send` combined.
293+
///
294+
/// This function is idempotent. Shutting a down a direction more than once
295+
/// has no effect and returns `ok`.
308296
///
309297
/// The shutdown function does not close (drop) the socket.
310298
///

wit/deps/sockets/udp-create-socket.wit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ interface udp-create-socket {
66
/// Create a new UDP socket.
77
///
88
/// Similar to `socket(AF_INET or AF_INET6, SOCK_DGRAM, IPPROTO_UDP)` in POSIX.
9+
/// On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.
910
///
1011
/// This function does not require a network capability handle. This is considered to be safe because
1112
/// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind` is called,

wit/deps/sockets/udp.wit

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ interface udp {
9292
///
9393
/// # Typical errors
9494
/// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT)
95-
/// - `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)
9695
/// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL)
9796
/// - `invalid-argument`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL)
9897
/// - `invalid-state`: The socket is not bound.
@@ -142,17 +141,6 @@ interface udp {
142141
/// Equivalent to the SO_DOMAIN socket option.
143142
address-family: func() -> ip-address-family;
144143

145-
/// Whether IPv4 compatibility (dual-stack) mode is disabled or not.
146-
///
147-
/// Equivalent to the IPV6_V6ONLY socket option.
148-
///
149-
/// # Typical errors
150-
/// - `not-supported`: (get/set) `this` socket is an IPv4 socket.
151-
/// - `invalid-state`: (set) The socket is already bound.
152-
/// - `not-supported`: (set) Host does not support dual-stack sockets. (Implementations are not required to.)
153-
ipv6-only: func() -> result<bool, error-code>;
154-
set-ipv6-only: func(value: bool) -> result<_, error-code>;
155-
156144
/// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options.
157145
///
158146
/// If the provided value is 0, an `invalid-argument` error is returned.
@@ -248,7 +236,6 @@ interface udp {
248236
///
249237
/// # Typical errors
250238
/// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT)
251-
/// - `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)
252239
/// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL)
253240
/// - `invalid-argument`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL)
254241
/// - `invalid-argument`: The socket is in "connected" mode and `remote-address` is `some` value that does not match the address passed to `stream`. (EISCONN)

0 commit comments

Comments
 (0)