diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5df3460..af3c079 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,4 @@ jobs: ./wit-deps lock git add -N wit/deps git diff --exit-code - - uses: WebAssembly/wit-abi-up-to-date@v15 + - uses: WebAssembly/wit-abi-up-to-date@v16 diff --git a/wit/deps.lock b/wit/deps.lock index 41d5cbb..e73913b 100644 --- a/wit/deps.lock +++ b/wit/deps.lock @@ -1,4 +1,4 @@ [io] url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz" -sha256 = "6e20bcf4d4f5466b60c05ea8da7289ca361a7febdd22ab1a531e5ef7e394ab8d" -sha512 = "21f6689bce6ed6d9e3bd96372e5c7ed003a7aefbf8d49b4eea949dfbd265cf57a0d7dc67aa71e3de75d48fcc2c0cfe5f06f7e9e7959a23bc98f77da85f4161b9" +sha256 = "a00c29dd57dc224e8ce28b793b19c1b1001dcdbdc229ed451c3df1db91841b34" +sha512 = "8558085eeb5689209101cdfbc9782953d559ad14ce77260fe2f7cc472482d568f65cad9e6a688d40c634c6c54c608f27e27e481633446114d6fdead93d4e34c5" diff --git a/wit/deps/io/poll.wit b/wit/deps/io/poll.wit index e95762b..254f534 100644 --- a/wit/deps/io/poll.wit +++ b/wit/deps/io/poll.wit @@ -1,10 +1,10 @@ -package wasi:io +package wasi:io; /// A poll API intended to let users wait for I/O events on multiple handles /// at once. interface poll { /// A "pollable" handle. - resource pollable + resource pollable; /// Poll for completion on a set of pollables. /// @@ -24,11 +24,11 @@ interface poll { /// do any I/O so it doesn't fail. If any of the I/O sources identified by /// the pollables has an error, it is indicated by marking the source as /// being reaedy for I/O. - poll-list: func(in: list>) -> list + poll-list: func(in: list>) -> list; /// Poll for completion on a single pollable. /// /// This function is similar to `poll-list`, but operates on only a single /// pollable. When it returns, the handle is ready for I/O. - poll-one: func(in: borrow) + poll-one: func(in: borrow); } diff --git a/wit/deps/io/streams.wit b/wit/deps/io/streams.wit index eeeff50..cfeab0d 100644 --- a/wit/deps/io/streams.wit +++ b/wit/deps/io/streams.wit @@ -1,4 +1,4 @@ -package wasi:io +package wasi:io; /// WASI I/O is an I/O abstraction API which is currently focused on providing /// stream types. @@ -6,7 +6,7 @@ package wasi:io /// In the future, the component model is expected to add built-in stream types; /// when it does, they are expected to subsume this API. interface streams { - use poll.{pollable} + use poll.{pollable}; /// Streams provide a sequence of data and then end; once they end, they /// no longer provide any further data. @@ -58,14 +58,14 @@ interface streams { read: func( /// The maximum number of bytes to read len: u64 - ) -> result, stream-status>> + ) -> result, stream-status>>; /// Read bytes from a stream, after blocking until at least one byte can /// be read. Except for blocking, identical to `read`. blocking-read: func( /// The maximum number of bytes to read len: u64 - ) -> result, stream-status>> + ) -> result, stream-status>>; /// Skip bytes from a stream. /// @@ -82,14 +82,14 @@ interface streams { skip: func( /// The maximum number of bytes to skip. len: u64, - ) -> result> + ) -> result>; /// Skip bytes from a stream, after blocking until at least one byte /// can be skipped. Except for blocking behavior, identical to `skip`. blocking-skip: func( /// The maximum number of bytes to skip. len: u64, - ) -> result> + ) -> result>; /// Create a `pollable` which will resolve once either the specified stream /// has bytes available to read or the other end of the stream has been @@ -97,7 +97,7 @@ interface streams { /// The created `pollable` is a child resource of the `input-stream`. /// Implementations may trap if the `input-stream` is dropped before /// all derived `pollable`s created with this function are dropped. - subscribe: func() -> pollable + subscribe: func() -> pollable; } /// An error for output-stream operations. @@ -131,7 +131,7 @@ interface streams { /// When this function returns 0 bytes, the `subscribe` pollable will /// become ready when this function will report at least 1 byte, or an /// error. - check-write: func() -> result + check-write: func() -> result; /// Perform a write. This function never blocks. /// @@ -142,7 +142,7 @@ interface streams { /// the last call to check-write provided a permit. write: func( contents: list - ) -> result<_, write-error> + ) -> result<_, write-error>; /// 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. @@ -170,7 +170,7 @@ interface streams { /// ``` blocking-write-and-flush: func( contents: list - ) -> result<_, write-error> + ) -> result<_, write-error>; /// Request to flush buffered output. This function never blocks. /// @@ -182,11 +182,11 @@ interface streams { /// writes (`check-write` will return `ok(0)`) until the flush has /// completed. The `subscribe` pollable will become ready when the /// flush has completed and the stream can accept more writes. - flush: func() -> result<_, write-error> + flush: func() -> result<_, write-error>; /// Request to flush buffered output, and block until flush completes /// and stream is ready for writing again. - blocking-flush: func() -> result<_, write-error> + blocking-flush: func() -> result<_, write-error>; /// Create a `pollable` which will resolve once the output-stream /// is ready for more writing, or an error has occured. When this @@ -198,7 +198,7 @@ interface streams { /// The created `pollable` is a child resource of the `output-stream`. /// Implementations may trap if the `output-stream` is dropped before /// all derived `pollable`s created with this function are dropped. - subscribe: func() -> pollable + subscribe: func() -> pollable; /// Write zeroes to a stream. /// @@ -209,7 +209,7 @@ interface streams { write-zeroes: func( /// The number of zero-bytes to write len: u64 - ) -> result<_, write-error> + ) -> result<_, write-error>; /// Perform a write of up to 4096 zeroes, and then flush the stream. /// Block until all of these operations are complete, or an error @@ -238,7 +238,7 @@ interface streams { blocking-write-zeroes-and-flush: func( /// The number of zero-bytes to write len: u64 - ) -> result<_, write-error> + ) -> result<_, write-error>; /// Read from one stream and write to another. /// @@ -252,7 +252,7 @@ interface streams { src: input-stream, /// The number of bytes to splice len: u64, - ) -> result> + ) -> result>; /// Read from one stream and write to another, with blocking. /// @@ -263,7 +263,7 @@ interface streams { src: input-stream, /// The number of bytes to splice len: u64, - ) -> result> + ) -> result>; /// Forward the entire contents of an input stream to an output stream. /// @@ -280,6 +280,6 @@ interface streams { forward: func( /// The stream to read from src: input-stream - ) -> result> + ) -> result>; } } diff --git a/wit/deps/io/world.wit b/wit/deps/io/world.wit index 8738dba..05244a9 100644 --- a/wit/deps/io/world.wit +++ b/wit/deps/io/world.wit @@ -1,6 +1,6 @@ -package wasi:io +package wasi:io; world imports { - import streams - import poll + import streams; + import poll; } diff --git a/wit/instance-network.wit b/wit/instance-network.wit index d911a29..14e4479 100644 --- a/wit/instance-network.wit +++ b/wit/instance-network.wit @@ -1,9 +1,9 @@ /// This interface provides a value-export of the default network handle.. interface instance-network { - use network.{network} + use network.{network}; /// Get a handle to the default network. - instance-network: func() -> network + instance-network: func() -> network; } diff --git a/wit/ip-name-lookup.wit b/wit/ip-name-lookup.wit index f998aae..b51fe05 100644 --- a/wit/ip-name-lookup.wit +++ b/wit/ip-name-lookup.wit @@ -1,7 +1,7 @@ interface ip-name-lookup { - use wasi:io/poll.{pollable} - use network.{network, error-code, ip-address, ip-address-family} + use wasi:io/poll.{pollable}; + use network.{network, error-code, ip-address, ip-address-family}; /// Resolve an internet host name to a list of IP addresses. @@ -34,7 +34,7 @@ interface ip-name-lookup { /// - /// - /// - - resolve-addresses: func(network: borrow, name: string, address-family: option, include-unavailable: bool) -> result + resolve-addresses: func(network: borrow, name: string, address-family: option, include-unavailable: bool) -> result; resource resolve-address-stream { /// Returns the next address from the resolver. @@ -50,12 +50,12 @@ interface ip-name-lookup { /// - `temporary-resolver-failure`: A temporary failure in name resolution occurred. (EAI_AGAIN) /// - `permanent-resolver-failure`: A permanent failure in name resolution occurred. (EAI_FAIL) /// - `would-block`: A result is not available yet. (EWOULDBLOCK, EAGAIN) - resolve-next-address: func() -> result, error-code> + resolve-next-address: func() -> result, error-code>; /// Create a `pollable` which will resolve once the stream is ready for I/O. /// /// Note: this function is here for WASI Preview2 only. /// It's planned to be removed when `future` is natively supported in Preview3. - subscribe: func() -> pollable + subscribe: func() -> pollable; } } diff --git a/wit/network.wit b/wit/network.wit index 8214eaa..e269595 100644 --- a/wit/network.wit +++ b/wit/network.wit @@ -3,7 +3,7 @@ interface network { /// An opaque resource that represents access to (a subset of) the network. /// This enables context-based security for networking. /// There is no need for this to map 1:1 to a physical network interface. - resource network + resource network; /// Error codes. /// @@ -150,8 +150,8 @@ interface network { ipv6, } - type ipv4-address = tuple - type ipv6-address = tuple + type ipv4-address = tuple; + type ipv6-address = tuple; variant ip-address { ipv4(ipv4-address), diff --git a/wit/tcp-create-socket.wit b/wit/tcp-create-socket.wit index f43bc89..056bbef 100644 --- a/wit/tcp-create-socket.wit +++ b/wit/tcp-create-socket.wit @@ -1,7 +1,7 @@ interface tcp-create-socket { - use network.{network, error-code, ip-address-family} - use tcp.{tcp-socket} + use network.{network, error-code, ip-address-family}; + use tcp.{tcp-socket}; /// Create a new TCP socket. /// @@ -23,5 +23,5 @@ interface tcp-create-socket { /// - /// - /// - - create-tcp-socket: func(address-family: ip-address-family) -> result + create-tcp-socket: func(address-family: ip-address-family) -> result; } diff --git a/wit/tcp.wit b/wit/tcp.wit index 175626c..fea4438 100644 --- a/wit/tcp.wit +++ b/wit/tcp.wit @@ -1,8 +1,8 @@ interface tcp { - use wasi:io/streams.{input-stream, output-stream} - use wasi:io/poll.{pollable} - use network.{network, error-code, ip-socket-address, ip-address-family} + use wasi:io/streams.{input-stream, output-stream}; + use wasi:io/poll.{pollable}; + use network.{network, error-code, ip-socket-address, ip-address-family}; enum shutdown-type { /// Similar to `SHUT_RD` in POSIX. @@ -46,8 +46,8 @@ interface tcp { /// - /// - /// - - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code> - finish-bind: func() -> result<_, error-code> + start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; + finish-bind: func() -> result<_, error-code>; /// Connect to a remote endpoint. /// @@ -78,8 +78,8 @@ interface tcp { /// - /// - /// - - start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code> - finish-connect: func() -> result, error-code> + start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code>; + finish-connect: func() -> result, error-code>; /// Start listening for new connections. /// @@ -105,8 +105,8 @@ interface tcp { /// - /// - /// - - start-listen: func() -> result<_, error-code> - finish-listen: func() -> result<_, error-code> + start-listen: func() -> result<_, error-code>; + finish-listen: func() -> result<_, error-code>; /// Accept a new client socket. /// @@ -126,7 +126,7 @@ interface tcp { /// - /// - /// - - accept: func() -> result, error-code> + accept: func() -> result, error-code>; /// Get the bound local address. /// @@ -138,7 +138,7 @@ interface tcp { /// - /// - /// - - local-address: func() -> result + local-address: func() -> result; /// Get the bound remote address. /// @@ -150,12 +150,12 @@ interface tcp { /// - /// - /// - - remote-address: func() -> result + remote-address: func() -> result; /// Whether this is a IPv4 or IPv6 socket. /// /// Equivalent to the SO_DOMAIN socket option. - address-family: func() -> ip-address-family + address-family: func() -> ip-address-family; /// Whether IPv4 compatibility (dual-stack) mode is disabled or not. /// @@ -166,29 +166,29 @@ interface tcp { /// - `already-bound`: (set) The socket is already bound. /// - `not-supported`: (set) Host does not support dual-stack sockets. (Implementations are not required to.) /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - ipv6-only: func() -> result - set-ipv6-only: func(value: bool) -> result<_, error-code> + ipv6-only: func() -> result; + set-ipv6-only: func(value: bool) -> result<_, error-code>; /// Hints the desired listen queue size. Implementations are free to ignore this. /// /// # Typical errors /// - `already-connected`: (set) The socket is already in the Connection state. /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - set-listen-backlog-size: func(value: u64) -> result<_, error-code> + set-listen-backlog-size: func(value: u64) -> result<_, error-code>; /// Equivalent to the SO_KEEPALIVE socket option. /// /// # Typical errors /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - keep-alive: func() -> result - set-keep-alive: func(value: bool) -> result<_, error-code> + keep-alive: func() -> result; + set-keep-alive: func(value: bool) -> result<_, error-code>; /// Equivalent to the TCP_NODELAY socket option. /// /// # Typical errors /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - no-delay: func() -> result - set-no-delay: func(value: bool) -> result<_, error-code> + no-delay: func() -> result; + set-no-delay: func(value: bool) -> result<_, error-code>; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. /// @@ -196,8 +196,8 @@ interface tcp { /// - `already-connected`: (set) The socket is already in the Connection state. /// - `already-listening`: (set) The socket is already in the Listener state. /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - unicast-hop-limit: func() -> result - set-unicast-hop-limit: func(value: u8) -> result<_, error-code> + unicast-hop-limit: func() -> result; + set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; /// The kernel buffer space reserved for sends/receives on this socket. /// @@ -214,16 +214,16 @@ interface tcp { /// - `already-connected`: (set) The socket is already in the Connection state. /// - `already-listening`: (set) The socket is already in the Listener state. /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - receive-buffer-size: func() -> result - set-receive-buffer-size: func(value: u64) -> result<_, error-code> - send-buffer-size: func() -> result - set-send-buffer-size: func(value: u64) -> result<_, error-code> + receive-buffer-size: func() -> result; + set-receive-buffer-size: func(value: u64) -> result<_, error-code>; + send-buffer-size: func() -> result; + set-send-buffer-size: func(value: u64) -> result<_, error-code>; /// Create a `pollable` which will resolve once the socket is ready for I/O. /// /// Note: this function is here for WASI Preview2 only. /// It's planned to be removed when `future` is natively supported in Preview3. - subscribe: func() -> pollable + subscribe: func() -> pollable; /// Initiate a graceful shutdown. /// @@ -244,6 +244,6 @@ interface tcp { /// - /// - /// - - shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code> + shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code>; } } diff --git a/wit/udp-create-socket.wit b/wit/udp-create-socket.wit index cd4c08f..66f9482 100644 --- a/wit/udp-create-socket.wit +++ b/wit/udp-create-socket.wit @@ -1,7 +1,7 @@ interface udp-create-socket { - use network.{network, error-code, ip-address-family} - use udp.{udp-socket} + use network.{network, error-code, ip-address-family}; + use udp.{udp-socket}; /// Create a new UDP socket. /// @@ -23,5 +23,5 @@ interface udp-create-socket { /// - /// - /// - - create-udp-socket: func(address-family: ip-address-family) -> result + create-udp-socket: func(address-family: ip-address-family) -> result; } diff --git a/wit/udp.wit b/wit/udp.wit index 01e5b95..e20b57e 100644 --- a/wit/udp.wit +++ b/wit/udp.wit @@ -1,7 +1,7 @@ interface udp { - use wasi:io/poll.{pollable} - use network.{network, error-code, ip-socket-address, ip-address-family} + use wasi:io/poll.{pollable}; + use network.{network, error-code, ip-socket-address, ip-address-family}; record datagram { @@ -47,8 +47,8 @@ interface udp { /// - /// - /// - - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code> - finish-bind: func() -> result<_, error-code> + start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; + finish-bind: func() -> result<_, error-code>; /// Set the destination address. /// @@ -79,8 +79,8 @@ interface udp { /// - /// - /// - - start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code> - finish-connect: func() -> result<_, error-code> + start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code>; + finish-connect: func() -> result<_, error-code>; /// Receive messages on the socket. /// @@ -102,7 +102,7 @@ interface udp { /// - /// - /// - - receive: func(max-results: u64) -> result, error-code> + receive: func(max-results: u64) -> result, error-code>; /// Send messages on the socket. /// @@ -137,7 +137,7 @@ interface udp { /// - /// - /// - - send: func(datagrams: list) -> result + send: func(datagrams: list) -> result; /// Get the current bound address. /// @@ -149,7 +149,7 @@ interface udp { /// - /// - /// - - local-address: func() -> result + local-address: func() -> result; /// Get the address set with `connect`. /// @@ -161,12 +161,12 @@ interface udp { /// - /// - /// - - remote-address: func() -> result + remote-address: func() -> result; /// Whether this is a IPv4 or IPv6 socket. /// /// Equivalent to the SO_DOMAIN socket option. - address-family: func() -> ip-address-family + address-family: func() -> ip-address-family; /// Whether IPv4 compatibility (dual-stack) mode is disabled or not. /// @@ -177,15 +177,15 @@ interface udp { /// - `already-bound`: (set) The socket is already bound. /// - `not-supported`: (set) Host does not support dual-stack sockets. (Implementations are not required to.) /// - `concurrency-conflict`: (set) Another `bind` or `connect` operation is already in progress. (EALREADY) - ipv6-only: func() -> result - set-ipv6-only: func(value: bool) -> result<_, error-code> + ipv6-only: func() -> result; + set-ipv6-only: func(value: bool) -> result<_, error-code>; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. /// /// # Typical errors /// - `concurrency-conflict`: (set) Another `bind` or `connect` operation is already in progress. (EALREADY) - unicast-hop-limit: func() -> result - set-unicast-hop-limit: func(value: u8) -> result<_, error-code> + unicast-hop-limit: func() -> result; + set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; /// The kernel buffer space reserved for sends/receives on this socket. /// @@ -200,15 +200,15 @@ interface udp { /// /// # Typical errors /// - `concurrency-conflict`: (set) Another `bind` or `connect` operation is already in progress. (EALREADY) - receive-buffer-size: func() -> result - set-receive-buffer-size: func(value: u64) -> result<_, error-code> - send-buffer-size: func() -> result - set-send-buffer-size: func(value: u64) -> result<_, error-code> + receive-buffer-size: func() -> result; + set-receive-buffer-size: func(value: u64) -> result<_, error-code>; + send-buffer-size: func() -> result; + set-send-buffer-size: func(value: u64) -> result<_, error-code>; /// Create a `pollable` which will resolve once the socket is ready for I/O. /// /// Note: this function is here for WASI Preview2 only. /// It's planned to be removed when `future` is natively supported in Preview3. - subscribe: func() -> pollable + subscribe: func() -> pollable; } } diff --git a/wit/world.wit b/wit/world.wit index 12f3c28..432b0dc 100644 --- a/wit/world.wit +++ b/wit/world.wit @@ -1,11 +1,11 @@ -package wasi:sockets +package wasi:sockets; world imports { - import instance-network - import network - import udp - import udp-create-socket - import tcp - import tcp-create-socket - import ip-name-lookup + import instance-network; + import network; + import udp; + import udp-create-socket; + import tcp; + import tcp-create-socket; + import ip-name-lookup; }