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 3196082..d8f0322 100644 --- a/wit/deps.lock +++ b/wit/deps.lock @@ -1,9 +1,9 @@ [clocks] url = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz" -sha256 = "ea955af7a152f85941b651c5b07345c4f077ae7f9e996c909ab8cc0a68c0120e" -sha512 = "114bc4f583a487cf1ccfdd6efa25c4c60cf637d4501a189eebd4b1d52aec2c8eb63ae14ce494db53dfd25bc20f6c4b533dc6f2143537e5cd14ca80d5d4b6a49d" +sha256 = "74844f8bf1d356bb44aab64a2f917d7a3bcb6d6924662d2e3909aeabda01bea6" +sha512 = "ef21339a60a3f4a37eb48ab81b411c1f2ed11c9b23da04d1e384c07dd4cc75f1a433ce7b46201c693b7a59b51c73d888bc41c78ad204fe32d8a312a9f9a48eb0" [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/clocks/monotonic-clock.wit b/wit/deps/clocks/monotonic-clock.wit index 703a5fb..d9ac7cb 100644 --- a/wit/deps/clocks/monotonic-clock.wit +++ b/wit/deps/clocks/monotonic-clock.wit @@ -9,24 +9,24 @@ /// /// It is intended for measuring elapsed time. interface monotonic-clock { - use wasi:io/poll.{pollable} + use wasi:io/poll.{pollable}; /// A timestamp in nanoseconds. - type instant = u64 + type instant = u64; /// Read the current value of the clock. /// /// The clock is monotonic, therefore calling this function repeatedly will /// produce a sequence of non-decreasing values. - now: func() -> instant + now: func() -> instant; /// Query the resolution of the clock. - resolution: func() -> instant + resolution: func() -> instant; /// Create a `pollable` which will resolve once the specified time has been /// reached. subscribe: func( when: instant, absolute: bool - ) -> pollable + ) -> pollable; } diff --git a/wit/deps/clocks/timezone.wit b/wit/deps/clocks/timezone.wit index a872bff..e717e7b 100644 --- a/wit/deps/clocks/timezone.wit +++ b/wit/deps/clocks/timezone.wit @@ -1,5 +1,5 @@ interface timezone { - use wall-clock.{datetime} + use wall-clock.{datetime}; /// Return information needed to display the given `datetime`. This includes /// the UTC offset, the time zone name, and a flag indicating whether @@ -8,10 +8,10 @@ interface timezone { /// If the timezone cannot be determined for the given `datetime`, return a /// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight /// saving time. - display: func(when: datetime) -> timezone-display + display: func(when: datetime) -> timezone-display; /// The same as `display`, but only return the UTC offset. - utc-offset: func(when: datetime) -> s32 + utc-offset: func(when: datetime) -> s32; /// Information useful for displaying the timezone of a specific `datetime`. /// diff --git a/wit/deps/clocks/wall-clock.wit b/wit/deps/clocks/wall-clock.wit index dae44a7..c395649 100644 --- a/wit/deps/clocks/wall-clock.wit +++ b/wit/deps/clocks/wall-clock.wit @@ -32,10 +32,10 @@ interface wall-clock { /// /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time - now: func() -> datetime + now: func() -> datetime; /// Query the resolution of the clock. /// /// The nanoseconds field of the output is always less than 1000000000. - resolution: func() -> datetime + resolution: func() -> datetime; } diff --git a/wit/deps/clocks/world.wit b/wit/deps/clocks/world.wit index 5c2dd41..3295ba8 100644 --- a/wit/deps/clocks/world.wit +++ b/wit/deps/clocks/world.wit @@ -1,7 +1,7 @@ -package wasi:clocks +package wasi:clocks; world imports { - import monotonic-clock - import wall-clock - import timezone + import monotonic-clock; + import wall-clock; + import timezone; } 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/preopens.wit b/wit/preopens.wit index f45661b..3f787ac 100644 --- a/wit/preopens.wit +++ b/wit/preopens.wit @@ -1,6 +1,6 @@ interface preopens { - use types.{descriptor} + use types.{descriptor}; /// Return the set of preopened directories, and their path. - get-directories: func() -> list> + get-directories: func() -> list>; } diff --git a/wit/types.wit b/wit/types.wit index 3f69bf9..2050fb9 100644 --- a/wit/types.wit +++ b/wit/types.wit @@ -23,11 +23,11 @@ /// /// [WASI filesystem path resolution]: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md interface types { - use wasi:io/streams.{input-stream, output-stream} - use wasi:clocks/wall-clock.{datetime} + use wasi:io/streams.{input-stream, output-stream}; + use wasi:clocks/wall-clock.{datetime}; /// File size or length of a region within a file. - type filesize = u64 + type filesize = u64; /// The type of a filesystem object referenced by a descriptor. /// @@ -166,7 +166,7 @@ interface types { } /// Number of hard links to an inode. - type link-count = u64 + type link-count = u64; /// When setting a timestamp, this gives the value to set it to. variant new-timestamp { @@ -315,7 +315,7 @@ interface types { read-via-stream: func( /// The offset within the file at which to start reading. offset: filesize, - ) -> result + ) -> result; /// Return a stream for writing to a file, if available. /// @@ -326,7 +326,7 @@ interface types { write-via-stream: func( /// The offset within the file at which to start writing. offset: filesize, - ) -> result + ) -> result; /// Return a stream for appending to a file, if available. /// @@ -334,7 +334,7 @@ interface types { /// /// Note: This allows using `write-stream`, which is similar to `write` with /// `O_APPEND` in in POSIX. - append-via-stream: func() -> result + append-via-stream: func() -> result; /// Provide file advisory information on a descriptor. /// @@ -346,7 +346,7 @@ interface types { length: filesize, /// The advice. advice: advice - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Synchronize the data of a file to disk. /// @@ -354,7 +354,7 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fdatasync` in POSIX. - sync-data: func() -> result<_, error-code> + sync-data: func() -> result<_, error-code>; /// Get flags associated with a descriptor. /// @@ -362,7 +362,7 @@ interface types { /// /// Note: This returns the value that was the `fs_flags` value returned /// from `fdstat_get` in earlier versions of WASI. - get-flags: func() -> result + get-flags: func() -> result; /// Get the dynamic type of a descriptor. /// @@ -374,13 +374,13 @@ interface types { /// /// Note: This returns the value that was the `fs_filetype` value returned /// from `fdstat_get` in earlier versions of WASI. - get-type: func() -> result + get-type: func() -> result; /// Adjust the size of an open file. If this increases the file's size, the /// extra bytes are filled with zeros. /// /// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. - set-size: func(size: filesize) -> result<_, error-code> + set-size: func(size: filesize) -> result<_, error-code>; /// Adjust the timestamps of an open file or directory. /// @@ -392,7 +392,7 @@ interface types { data-access-timestamp: new-timestamp, /// The desired values of the data modification timestamp. data-modification-timestamp: new-timestamp, - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Read from a descriptor, without using and updating the descriptor's offset. /// @@ -410,7 +410,7 @@ interface types { length: filesize, /// The offset within the file at which to read. offset: filesize, - ) -> result, bool>, error-code> + ) -> result, bool>, error-code>; /// Write to a descriptor, without using and updating the descriptor's offset. /// @@ -426,7 +426,7 @@ interface types { buffer: list, /// The offset within the file at which to write. offset: filesize, - ) -> result + ) -> result; /// Read directory entries from a directory. /// @@ -437,7 +437,7 @@ interface types { /// This always returns a new stream which starts at the beginning of the /// directory. Multiple streams may be active on the same directory, and they /// do not interfere with each other. - read-directory: func() -> result + read-directory: func() -> result; /// Synchronize the data and metadata of a file to disk. /// @@ -445,7 +445,7 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fsync` in POSIX. - sync: func() -> result<_, error-code> + sync: func() -> result<_, error-code>; /// Create a directory. /// @@ -453,7 +453,7 @@ interface types { create-directory-at: func( /// The relative path at which to create the directory. path: string, - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Return the attributes of an open file or directory. /// @@ -464,7 +464,7 @@ interface types { /// modified, use `metadata-hash`. /// /// Note: This was called `fd_filestat_get` in earlier versions of WASI. - stat: func() -> result + stat: func() -> result; /// Return the attributes of a file or directory. /// @@ -478,7 +478,7 @@ interface types { path-flags: path-flags, /// The relative path of the file or directory to inspect. path: string, - ) -> result + ) -> result; /// Adjust the timestamps of a file or directory. /// @@ -495,7 +495,7 @@ interface types { data-access-timestamp: new-timestamp, /// The desired values of the data modification timestamp. data-modification-timestamp: new-timestamp, - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Create a hard link. /// @@ -509,7 +509,7 @@ interface types { new-descriptor: borrow, /// The relative destination path at which to create the hard link. new-path: string, - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Open a file or directory. /// @@ -540,7 +540,7 @@ interface types { %flags: descriptor-flags, /// Permissions to use when creating a new file. modes: modes - ) -> result + ) -> result; /// Read the contents of a symbolic link. /// @@ -551,7 +551,7 @@ interface types { readlink-at: func( /// The relative path of the symbolic link from which to read. path: string, - ) -> result + ) -> result; /// Remove a directory. /// @@ -561,7 +561,7 @@ interface types { remove-directory-at: func( /// The relative path to a directory to remove. path: string, - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Rename a filesystem object. /// @@ -573,7 +573,7 @@ interface types { new-descriptor: borrow, /// The relative destination path to which to rename the file or directory. new-path: string, - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Create a symbolic link (also known as a "symlink"). /// @@ -586,7 +586,7 @@ interface types { old-path: string, /// The relative destination path at which to create the symbolic link. new-path: string, - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Check accessibility of a filesystem path. /// @@ -605,7 +605,7 @@ interface types { path: string, /// The type of check to perform. %type: access-type - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Unlink a filesystem object that is not a directory. /// @@ -614,7 +614,7 @@ interface types { unlink-file-at: func( /// The relative path to a file to unlink. path: string, - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Change the permissions of a filesystem object that is not a directory. /// @@ -629,7 +629,7 @@ interface types { path: string, /// The new permissions for the filesystem object. modes: modes, - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Change the permissions of a directory. /// @@ -648,7 +648,7 @@ interface types { path: string, /// The new permissions for the directory. modes: modes, - ) -> result<_, error-code> + ) -> result<_, error-code>; /// Request a shared advisory lock for an open file. /// @@ -670,7 +670,7 @@ interface types { /// locking, this function returns `error-code::unsupported`. /// /// Note: This is similar to `flock(fd, LOCK_SH)` in Unix. - lock-shared: func() -> result<_, error-code> + lock-shared: func() -> result<_, error-code>; /// Request an exclusive advisory lock for an open file. /// @@ -694,7 +694,7 @@ interface types { /// locking, this function returns `error-code::unsupported`. /// /// Note: This is similar to `flock(fd, LOCK_EX)` in Unix. - lock-exclusive: func() -> result<_, error-code> + lock-exclusive: func() -> result<_, error-code>; /// Request a shared advisory lock for an open file. /// @@ -717,7 +717,7 @@ interface types { /// locking, this function returns `error-code::unsupported`. /// /// Note: This is similar to `flock(fd, LOCK_SH | LOCK_NB)` in Unix. - try-lock-shared: func() -> result<_, error-code> + try-lock-shared: func() -> result<_, error-code>; /// Request an exclusive advisory lock for an open file. /// @@ -742,12 +742,12 @@ interface types { /// locking, this function returns `error-code::unsupported`. /// /// Note: This is similar to `flock(fd, LOCK_EX | LOCK_NB)` in Unix. - try-lock-exclusive: func() -> result<_, error-code> + try-lock-exclusive: func() -> result<_, error-code>; /// Release a shared or exclusive lock on an open file. /// /// Note: This is similar to `flock(fd, LOCK_UN)` in Unix. - unlock: func() -> result<_, error-code> + unlock: func() -> result<_, error-code>; /// Test whether two descriptors refer to the same filesystem object. /// @@ -755,7 +755,7 @@ interface types { /// same device (`st_dev`) and inode (`st_ino` or `d_ino`) numbers. /// wasi-filesystem does not expose device and inode numbers, so this function /// may be used instead. - is-same-object: func(other: borrow) -> bool + is-same-object: func(other: borrow) -> bool; /// Return a hash of the metadata associated with a filesystem object referred /// to by a descriptor. @@ -776,7 +776,7 @@ interface types { /// computed hash. /// /// However, none of these is required. - metadata-hash: func() -> result + metadata-hash: func() -> result; /// Return a hash of the metadata associated with a filesystem object referred /// to by a directory descriptor and a relative path. @@ -787,12 +787,12 @@ interface types { path-flags: path-flags, /// The relative path of the file or directory to inspect. path: string, - ) -> result + ) -> result; } /// A stream of directory entries. resource directory-entry-stream { /// Read a single directory entry from a `directory-entry-stream`. - read-directory-entry: func() -> result, error-code> + read-directory-entry: func() -> result, error-code>; } } diff --git a/wit/world.wit b/wit/world.wit index 5fa7eaf..bd47294 100644 --- a/wit/world.wit +++ b/wit/world.wit @@ -1,6 +1,6 @@ -package wasi:filesystem +package wasi:filesystem; world imports { - import types - import preopens + import types; + import preopens; }