diff --git a/crates/test-programs/src/lib.rs b/crates/test-programs/src/lib.rs index 82dbbdf25436..722929960354 100644 --- a/crates/test-programs/src/lib.rs +++ b/crates/test-programs/src/lib.rs @@ -11,8 +11,8 @@ wit_bindgen::generate!({ package wasmtime:test; world test { - include wasi:cli/imports@0.2.6; - include wasi:http/imports@0.2.6; + include wasi:cli/imports@0.2.9; + include wasi:http/imports@0.2.9; include wasi:config/imports@0.2.0-rc.1; include wasi:keyvalue/imports@0.2.0-draft; include wasi:tls/imports@0.2.0-draft; @@ -36,17 +36,16 @@ pub mod proxy { default_bindings_module: "test_programs::proxy", pub_export_macro: true, with: { - "wasi:http/types@0.2.6": crate::wasi::http::types, - "wasi:http/outgoing-handler@0.2.6": crate::wasi::http::outgoing_handler, - "wasi:random/random@0.2.6": crate::wasi::random::random, - "wasi:io/error@0.2.6": crate::wasi::io::error, - "wasi:io/poll@0.2.6": crate::wasi::io::poll, - "wasi:io/streams@0.2.6": crate::wasi::io::streams, - "wasi:cli/stdout@0.2.6": crate::wasi::cli::stdout, - "wasi:cli/stderr@0.2.6": crate::wasi::cli::stderr, - "wasi:cli/stdin@0.2.6": crate::wasi::cli::stdin, - "wasi:clocks/monotonic-clock@0.2.6": crate::wasi::clocks::monotonic_clock, - "wasi:clocks/wall-clock@0.2.6": crate::wasi::clocks::wall_clock, + "wasi:http/types@0.2.9": crate::wasi::http::types, + "wasi:random/random@0.2.9": crate::wasi::random::random, + "wasi:io/error@0.2.9": crate::wasi::io::error, + "wasi:io/poll@0.2.9": crate::wasi::io::poll, + "wasi:io/streams@0.2.9": crate::wasi::io::streams, + "wasi:cli/stdout@0.2.9": crate::wasi::cli::stdout, + "wasi:cli/stderr@0.2.9": crate::wasi::cli::stderr, + "wasi:cli/stdin@0.2.9": crate::wasi::cli::stdin, + "wasi:clocks/monotonic-clock@0.2.9": crate::wasi::clocks::monotonic_clock, + "wasi:clocks/wall-clock@0.2.9": crate::wasi::clocks::wall_clock, }, }); } diff --git a/crates/wasi-http/src/p3/wit/deps/clocks/system-clock.wit b/crates/wasi-http/src/p3/wit/deps/clocks/system-clock.wit new file mode 100644 index 000000000000..bd3049fd43c5 --- /dev/null +++ b/crates/wasi-http/src/p3/wit/deps/clocks/system-clock.wit @@ -0,0 +1,51 @@ +package wasi:clocks@0.3.0-rc-2025-09-16; +/// WASI System Clock is a clock API intended to let users query the current +/// time. The clock is not necessarily monotonic as it may be reset. +/// +/// It is intended to be portable at least between Unix-family platforms and +/// Windows. +/// +/// External references may be reset, so this clock is not necessarily +/// monotonic, making it unsuitable for measuring elapsed time. +/// +/// It is intended for reporting the current date and time for humans. +@since(version = 0.3.0-rc-2025-09-16) +interface system-clock { + use types.{duration}; + + /// An "instant", or "exact time", is a point in time without regard to any + /// time zone: just the time since a particular external reference point, + /// often called an "epoch". + /// + /// Here, the epoch is 1970-01-01T00:00:00Z, also known as + /// [POSIX's Seconds Since the Epoch], also known as [Unix Time]. + /// + /// Note that even if the seconds field is negative, incrementing + /// nanoseconds always represents moving forwards in time. + /// For example, `{ -1 seconds, 999999999 nanoseconds }` represents the + /// instant one nanosecond before the epoch. + /// For more on various different ways to represent time, see + /// https://tc39.es/proposal-temporal/docs/timezone.html + /// + /// [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 + @since(version = 0.3.0-rc-2025-09-16) + record instant { + seconds: s64, + nanoseconds: u32, + } + + /// Read the current value of the clock. + /// + /// This clock is not monotonic, therefore calling this function repeatedly + /// will not necessarily produce a sequence of non-decreasing values. + /// + /// The nanoseconds field of the output is always less than 1000000000. + @since(version = 0.3.0-rc-2025-09-16) + now: func() -> instant; + + /// Query the resolution of the clock. Returns the smallest duration of time + /// that the implementation permits distinguishing. + @since(version = 0.3.0-rc-2025-09-16) + get-resolution: func() -> duration; +} diff --git a/crates/wasi-http/wit/deps/cli/command.wit b/crates/wasi-http/wit/deps/cli/command.wit index 6d3cc83f5ffa..5f6eea568d41 100644 --- a/crates/wasi-http/wit/deps/cli/command.wit +++ b/crates/wasi-http/wit/deps/cli/command.wit @@ -1,4 +1,4 @@ -package wasi:cli@0.2.6; +package wasi:cli@0.2.9; @since(version = 0.2.0) world command { diff --git a/crates/wasi-http/wit/deps/cli/imports.wit b/crates/wasi-http/wit/deps/cli/imports.wit index d9fd017109a7..a12a40607222 100644 --- a/crates/wasi-http/wit/deps/cli/imports.wit +++ b/crates/wasi-http/wit/deps/cli/imports.wit @@ -1,17 +1,17 @@ -package wasi:cli@0.2.6; +package wasi:cli@0.2.9; @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.9; @since(version = 0.2.0) - include wasi:filesystem/imports@0.2.6; + include wasi:filesystem/imports@0.2.9; @since(version = 0.2.0) - include wasi:sockets/imports@0.2.6; + include wasi:sockets/imports@0.2.9; @since(version = 0.2.0) - include wasi:random/imports@0.2.6; + include wasi:random/imports@0.2.9; @since(version = 0.2.0) - include wasi:io/imports@0.2.6; + include wasi:io/imports@0.2.9; @since(version = 0.2.0) import environment; diff --git a/crates/wasi-http/wit/deps/cli/stdio.wit b/crates/wasi-http/wit/deps/cli/stdio.wit index cb8aea2d90e9..0994adc3da6a 100644 --- a/crates/wasi-http/wit/deps/cli/stdio.wit +++ b/crates/wasi-http/wit/deps/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.9.{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.9.{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.9.{output-stream}; @since(version = 0.2.0) get-stderr: func() -> output-stream; diff --git a/crates/wasi-http/wit/deps/clocks/monotonic-clock.wit b/crates/wasi-http/wit/deps/clocks/monotonic-clock.wit index f3bc83912754..76629501d600 100644 --- a/crates/wasi-http/wit/deps/clocks/monotonic-clock.wit +++ b/crates/wasi-http/wit/deps/clocks/monotonic-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.9; /// 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.9.{pollable}; /// An instant in time, in nanoseconds. An instant is relative to an /// unspecified initial value, and can only be compared to instances from @@ -26,6 +26,11 @@ interface monotonic-clock { /// /// The clock is monotonic, therefore calling this function repeatedly will /// produce a sequence of non-decreasing values. + /// + /// For completeness, this function traps if it's not possible to represent + /// the value of the clock in an `instant`. Consequently, implementations + /// should ensure that the starting time is low enough to avoid the + /// possibility of overflow in practice. @since(version = 0.2.0) now: func() -> instant; diff --git a/crates/wasi-http/wit/deps/clocks/timezone.wit b/crates/wasi-http/wit/deps/clocks/timezone.wit index ca98ad1528cc..0528c68f01ce 100644 --- a/crates/wasi-http/wit/deps/clocks/timezone.wit +++ b/crates/wasi-http/wit/deps/clocks/timezone.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.9; @unstable(feature = clocks-timezone) interface timezone { diff --git a/crates/wasi-http/wit/deps/clocks/wall-clock.wit b/crates/wasi-http/wit/deps/clocks/wall-clock.wit index 76636a0c9b2e..b7f4c9b71257 100644 --- a/crates/wasi-http/wit/deps/clocks/wall-clock.wit +++ b/crates/wasi-http/wit/deps/clocks/wall-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.9; /// 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/crates/wasi-http/wit/deps/clocks/world.wit b/crates/wasi-http/wit/deps/clocks/world.wit index 5c53c51a154e..931b0693e3e6 100644 --- a/crates/wasi-http/wit/deps/clocks/world.wit +++ b/crates/wasi-http/wit/deps/clocks/world.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi-http/wit/deps/filesystem/preopens.wit b/crates/wasi-http/wit/deps/filesystem/preopens.wit index f22847940328..f8cfeed96634 100644 --- a/crates/wasi-http/wit/deps/filesystem/preopens.wit +++ b/crates/wasi-http/wit/deps/filesystem/preopens.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.6; +package wasi:filesystem@0.2.9; @since(version = 0.2.0) interface preopens { diff --git a/crates/wasi-http/wit/deps/filesystem/types.wit b/crates/wasi-http/wit/deps/filesystem/types.wit index 75c19044c726..35ecbfccccdc 100644 --- a/crates/wasi-http/wit/deps/filesystem/types.wit +++ b/crates/wasi-http/wit/deps/filesystem/types.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.6; +package wasi:filesystem@0.2.9; /// 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.9.{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.9.{datetime}; /// File size or length of a region within a file. @since(version = 0.2.0) diff --git a/crates/wasi-http/wit/deps/filesystem/world.wit b/crates/wasi-http/wit/deps/filesystem/world.wit index 65597f9f29d9..0b29bf04d4bb 100644 --- a/crates/wasi-http/wit/deps/filesystem/world.wit +++ b/crates/wasi-http/wit/deps/filesystem/world.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.6; +package wasi:filesystem@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi-http/wit/deps/http/proxy.wit b/crates/wasi-http/wit/deps/http/proxy.wit index 5bd9f99894fd..d3b6d315672a 100644 --- a/crates/wasi-http/wit/deps/http/proxy.wit +++ b/crates/wasi-http/wit/deps/http/proxy.wit @@ -1,4 +1,4 @@ -package wasi:http@0.2.6; +package wasi:http@0.2.9; /// 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.9; @since(version = 0.2.0) - import wasi:clocks/wall-clock@0.2.6; + import wasi:clocks/wall-clock@0.2.9; @since(version = 0.2.0) - import wasi:random/random@0.2.6; + import wasi:random/random@0.2.9; /// 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.9; @since(version = 0.2.0) - import wasi:cli/stderr@0.2.6; + import wasi:cli/stderr@0.2.9; /// 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.9; /// This is the default handler to use when user code simply wants to make an /// HTTP request (e.g., via `fetch()`). diff --git a/crates/wasi-http/wit/deps/http/types.wit b/crates/wasi-http/wit/deps/http/types.wit index c9f3cc4b9ae5..835c32d027a3 100644 --- a/crates/wasi-http/wit/deps/http/types.wit +++ b/crates/wasi-http/wit/deps/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.9.{duration}; @since(version = 0.2.0) - use wasi:io/streams@0.2.6.{input-stream, output-stream}; + use wasi:io/streams@0.2.9.{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.9.{error as io-error}; @since(version = 0.2.0) - use wasi:io/poll@0.2.6.{pollable}; + use wasi:io/poll@0.2.9.{pollable}; /// This type corresponds to HTTP standard Methods. @since(version = 0.2.0) @@ -110,8 +110,8 @@ interface types { /// provided. /// /// Stream operations which return - /// `wasi:io/stream/stream-error::last-operation-failed` have a payload of - /// type `wasi:io/error/error` with more information about the operation + /// `wasi:io/stream.stream-error.last-operation-failed` have a payload of + /// type `wasi:io/error.error` with more information about the operation /// that failed. This payload can be passed through to this function to see /// if there's http-related information about the error to return. /// diff --git a/crates/wasi-http/wit/deps/io/error.wit b/crates/wasi-http/wit/deps/io/error.wit index 784f74a53e06..5f04c02047e5 100644 --- a/crates/wasi-http/wit/deps/io/error.wit +++ b/crates/wasi-http/wit/deps/io/error.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; @since(version = 0.2.0) interface error { @@ -8,14 +8,14 @@ interface error { /// which provides some human-readable information about the error. /// /// In the `wasi:io` package, this resource is returned through the - /// `wasi:io/streams/stream-error` type. + /// `wasi:io/streams.stream-error` type. /// /// To provide more specific error information, other interfaces may /// offer functions to "downcast" this error into more specific types. For example, /// errors returned from streams derived from filesystem types can be described using /// the filesystem's own error-code type. This is done using the function - /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow` - /// parameter and returns an `option`. + /// `wasi:filesystem/types.filesystem-error-code`, which takes a `borrow` + /// parameter and returns an `option`. /// /// The set of functions which can "downcast" an `error` into a more /// concrete type is open. diff --git a/crates/wasi-http/wit/deps/io/poll.wit b/crates/wasi-http/wit/deps/io/poll.wit index 7f711836c34e..96a319ae56e1 100644 --- a/crates/wasi-http/wit/deps/io/poll.wit +++ b/crates/wasi-http/wit/deps/io/poll.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; /// A poll API intended to let users wait for I/O events on multiple handles /// at once. diff --git a/crates/wasi-http/wit/deps/io/streams.wit b/crates/wasi-http/wit/deps/io/streams.wit index c5da38c862c8..c715ae31d445 100644 --- a/crates/wasi-http/wit/deps/io/streams.wit +++ b/crates/wasi-http/wit/deps/io/streams.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; /// 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/crates/wasi-http/wit/deps/io/world.wit b/crates/wasi-http/wit/deps/io/world.wit index 84c85c08ed18..d40e498b5734 100644 --- a/crates/wasi-http/wit/deps/io/world.wit +++ b/crates/wasi-http/wit/deps/io/world.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi-http/wit/deps/random/insecure-seed.wit b/crates/wasi-http/wit/deps/random/insecure-seed.wit index d3dc03a6c08e..e7fe5825dd87 100644 --- a/crates/wasi-http/wit/deps/random/insecure-seed.wit +++ b/crates/wasi-http/wit/deps/random/insecure-seed.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.9; /// 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/crates/wasi-http/wit/deps/random/insecure.wit b/crates/wasi-http/wit/deps/random/insecure.wit index d4d0284801d3..d4e28dbd8bfa 100644 --- a/crates/wasi-http/wit/deps/random/insecure.wit +++ b/crates/wasi-http/wit/deps/random/insecure.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.9; /// The insecure interface for insecure pseudo-random numbers. /// /// It is intended to be portable at least between Unix-family platforms and diff --git a/crates/wasi-http/wit/deps/random/random.wit b/crates/wasi-http/wit/deps/random/random.wit index a0ff95646a14..86a4567e383b 100644 --- a/crates/wasi-http/wit/deps/random/random.wit +++ b/crates/wasi-http/wit/deps/random/random.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.9; /// WASI Random is a random data API. /// /// It is intended to be portable at least between Unix-family platforms and diff --git a/crates/wasi-http/wit/deps/random/world.wit b/crates/wasi-http/wit/deps/random/world.wit index 099f47b36e36..05e6565d0f1f 100644 --- a/crates/wasi-http/wit/deps/random/world.wit +++ b/crates/wasi-http/wit/deps/random/world.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi-http/wit/deps/sockets/ip-name-lookup.wit b/crates/wasi-http/wit/deps/sockets/ip-name-lookup.wit index ee6419e7daff..682c331c6343 100644 --- a/crates/wasi-http/wit/deps/sockets/ip-name-lookup.wit +++ b/crates/wasi-http/wit/deps/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.9.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-address}; diff --git a/crates/wasi-http/wit/deps/sockets/network.wit b/crates/wasi-http/wit/deps/sockets/network.wit index 6ca98b63bc34..ca359ab8b29f 100644 --- a/crates/wasi-http/wit/deps/sockets/network.wit +++ b/crates/wasi-http/wit/deps/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.9.{error}; /// An opaque resource that represents access to (a subset of) the network. /// This enables context-based security for networking. diff --git a/crates/wasi-http/wit/deps/sockets/tcp.wit b/crates/wasi-http/wit/deps/sockets/tcp.wit index beefd7b465ec..51701221b4de 100644 --- a/crates/wasi-http/wit/deps/sockets/tcp.wit +++ b/crates/wasi-http/wit/deps/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.9.{input-stream, output-stream}; @since(version = 0.2.0) - use wasi:io/poll@0.2.6.{pollable}; + use wasi:io/poll@0.2.9.{pollable}; @since(version = 0.2.0) - use wasi:clocks/monotonic-clock@0.2.6.{duration}; + use wasi:clocks/monotonic-clock@0.2.9.{duration}; @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; diff --git a/crates/wasi-http/wit/deps/sockets/udp.wit b/crates/wasi-http/wit/deps/sockets/udp.wit index 9dbe6932dd14..1ed10e3cc972 100644 --- a/crates/wasi-http/wit/deps/sockets/udp.wit +++ b/crates/wasi-http/wit/deps/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.9.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; diff --git a/crates/wasi-http/wit/deps/sockets/world.wit b/crates/wasi-http/wit/deps/sockets/world.wit index e86f02cec6a2..2f856ed66496 100644 --- a/crates/wasi-http/wit/deps/sockets/world.wit +++ b/crates/wasi-http/wit/deps/sockets/world.wit @@ -1,4 +1,4 @@ -package wasi:sockets@0.2.6; +package wasi:sockets@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi-http/wit/world.wit b/crates/wasi-http/wit/world.wit index 69793510df9f..76c9bb77d512 100644 --- a/crates/wasi-http/wit/world.wit +++ b/crates/wasi-http/wit/world.wit @@ -2,5 +2,5 @@ package wasmtime:wasi-http; world bindings { - include wasi:http/proxy@0.2.6; + include wasi:http/proxy@0.2.9; } diff --git a/crates/wasi-preview1-component-adapter/src/descriptors.rs b/crates/wasi-preview1-component-adapter/src/descriptors.rs index 9ee1cf7d3415..be9a538b1eab 100644 --- a/crates/wasi-preview1-component-adapter/src/descriptors.rs +++ b/crates/wasi-preview1-component-adapter/src/descriptors.rs @@ -149,7 +149,7 @@ pub struct Descriptors { } #[cfg(not(feature = "proxy"))] -#[link(wasm_import_module = "wasi:filesystem/preopens@0.2.6")] +#[link(wasm_import_module = "wasi:filesystem/preopens@0.2.9")] unsafe extern "C" { #[link_name = "get-directories"] fn wasi_filesystem_get_directories(rval: *mut PreopenList); diff --git a/crates/wasi-preview1-component-adapter/src/lib.rs b/crates/wasi-preview1-component-adapter/src/lib.rs index 3e89ea191da0..d5817063da93 100644 --- a/crates/wasi-preview1-component-adapter/src/lib.rs +++ b/crates/wasi-preview1-component-adapter/src/lib.rs @@ -99,12 +99,12 @@ pub mod bindings { package wasmtime:adapter; world adapter { - import wasi:clocks/wall-clock@0.2.6; - import wasi:clocks/monotonic-clock@0.2.6; - import wasi:random/random@0.2.6; - import wasi:cli/stdout@0.2.6; - import wasi:cli/stderr@0.2.6; - import wasi:cli/stdin@0.2.6; + import wasi:clocks/wall-clock@0.2.9; + import wasi:clocks/monotonic-clock@0.2.9; + import wasi:random/random@0.2.9; + import wasi:cli/stdout@0.2.9; + import wasi:cli/stderr@0.2.9; + import wasi:cli/stdin@0.2.9; } "#, world: "wasmtime:adapter/adapter", @@ -122,7 +122,7 @@ pub mod bindings { } } -#[unsafe(export_name = "wasi:cli/run@0.2.6#run")] +#[unsafe(export_name = "wasi:cli/run@0.2.9#run")] #[cfg(feature = "command")] pub extern "C" fn run() -> u32 { #[link(wasm_import_module = "__main_module__")] @@ -469,7 +469,7 @@ impl BumpAlloc { } #[cfg(not(feature = "proxy"))] -#[link(wasm_import_module = "wasi:cli/environment@0.2.6")] +#[link(wasm_import_module = "wasi:cli/environment@0.2.9")] unsafe extern "C" { #[link_name = "get-arguments"] fn wasi_cli_get_arguments(rval: *mut WasmStrList); @@ -2209,7 +2209,7 @@ pub unsafe extern "C" fn poll_oneoff( } } - #[link(wasm_import_module = "wasi:io/poll@0.2.6")] + #[link(wasm_import_module = "wasi:io/poll@0.2.9")] unsafe extern "C" { #[link_name = "poll"] fn poll_import(pollables: *const Pollable, len: usize, rval: *mut ReadyList); diff --git a/crates/wasi-tls/wit/deps/io/error.wit b/crates/wasi-tls/wit/deps/io/error.wit index 784f74a53e06..5f04c02047e5 100644 --- a/crates/wasi-tls/wit/deps/io/error.wit +++ b/crates/wasi-tls/wit/deps/io/error.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; @since(version = 0.2.0) interface error { @@ -8,14 +8,14 @@ interface error { /// which provides some human-readable information about the error. /// /// In the `wasi:io` package, this resource is returned through the - /// `wasi:io/streams/stream-error` type. + /// `wasi:io/streams.stream-error` type. /// /// To provide more specific error information, other interfaces may /// offer functions to "downcast" this error into more specific types. For example, /// errors returned from streams derived from filesystem types can be described using /// the filesystem's own error-code type. This is done using the function - /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow` - /// parameter and returns an `option`. + /// `wasi:filesystem/types.filesystem-error-code`, which takes a `borrow` + /// parameter and returns an `option`. /// /// The set of functions which can "downcast" an `error` into a more /// concrete type is open. diff --git a/crates/wasi-tls/wit/deps/io/poll.wit b/crates/wasi-tls/wit/deps/io/poll.wit index 7f711836c34e..96a319ae56e1 100644 --- a/crates/wasi-tls/wit/deps/io/poll.wit +++ b/crates/wasi-tls/wit/deps/io/poll.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; /// A poll API intended to let users wait for I/O events on multiple handles /// at once. diff --git a/crates/wasi-tls/wit/deps/io/streams.wit b/crates/wasi-tls/wit/deps/io/streams.wit index c5da38c862c8..c715ae31d445 100644 --- a/crates/wasi-tls/wit/deps/io/streams.wit +++ b/crates/wasi-tls/wit/deps/io/streams.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; /// 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/crates/wasi-tls/wit/deps/io/world.wit b/crates/wasi-tls/wit/deps/io/world.wit index 84c85c08ed18..d40e498b5734 100644 --- a/crates/wasi-tls/wit/deps/io/world.wit +++ b/crates/wasi-tls/wit/deps/io/world.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi-tls/wit/deps/tls/types.wit b/crates/wasi-tls/wit/deps/tls/types.wit index f6b69b3f04bd..ba4d99b0c547 100644 --- a/crates/wasi-tls/wit/deps/tls/types.wit +++ b/crates/wasi-tls/wit/deps/tls/types.wit @@ -1,11 +1,11 @@ @unstable(feature = tls) interface types { @unstable(feature = tls) - use wasi:io/streams@0.2.6.{input-stream, output-stream}; + use wasi:io/streams@0.2.9.{input-stream, output-stream}; @unstable(feature = tls) - use wasi:io/poll@0.2.6.{pollable}; + use wasi:io/poll@0.2.9.{pollable}; @unstable(feature = tls) - use wasi:io/error@0.2.6.{error as io-error}; + use wasi:io/error@0.2.9.{error as io-error}; @unstable(feature = tls) resource client-handshake { diff --git a/crates/wasi/src/p2/bindings.rs b/crates/wasi/src/p2/bindings.rs index e60c7818f1fb..e0abd1f6e45d 100644 --- a/crates/wasi/src/p2/bindings.rs +++ b/crates/wasi/src/p2/bindings.rs @@ -26,7 +26,7 @@ //! // An example of extending the `wasi:cli/command` world with a //! // custom host interface. //! world my-world { -//! include wasi:cli/command@0.2.6; +//! include wasi:cli/command@0.2.9; //! //! import custom-host; //! } @@ -96,7 +96,7 @@ /// // An example of extending the `wasi:cli/command` world with a /// // custom host interface. /// world my-world { -/// include wasi:cli/command@0.2.6; +/// include wasi:cli/command@0.2.9; /// /// import custom-host; /// } diff --git a/crates/wasi/src/p2/wit/deps/cli/command.wit b/crates/wasi/src/p2/wit/deps/cli/command.wit index 6d3cc83f5ffa..5f6eea568d41 100644 --- a/crates/wasi/src/p2/wit/deps/cli/command.wit +++ b/crates/wasi/src/p2/wit/deps/cli/command.wit @@ -1,4 +1,4 @@ -package wasi:cli@0.2.6; +package wasi:cli@0.2.9; @since(version = 0.2.0) world command { diff --git a/crates/wasi/src/p2/wit/deps/cli/imports.wit b/crates/wasi/src/p2/wit/deps/cli/imports.wit index d9fd017109a7..a12a40607222 100644 --- a/crates/wasi/src/p2/wit/deps/cli/imports.wit +++ b/crates/wasi/src/p2/wit/deps/cli/imports.wit @@ -1,17 +1,17 @@ -package wasi:cli@0.2.6; +package wasi:cli@0.2.9; @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.9; @since(version = 0.2.0) - include wasi:filesystem/imports@0.2.6; + include wasi:filesystem/imports@0.2.9; @since(version = 0.2.0) - include wasi:sockets/imports@0.2.6; + include wasi:sockets/imports@0.2.9; @since(version = 0.2.0) - include wasi:random/imports@0.2.6; + include wasi:random/imports@0.2.9; @since(version = 0.2.0) - include wasi:io/imports@0.2.6; + include wasi:io/imports@0.2.9; @since(version = 0.2.0) import environment; diff --git a/crates/wasi/src/p2/wit/deps/cli/stdio.wit b/crates/wasi/src/p2/wit/deps/cli/stdio.wit index cb8aea2d90e9..0994adc3da6a 100644 --- a/crates/wasi/src/p2/wit/deps/cli/stdio.wit +++ b/crates/wasi/src/p2/wit/deps/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.9.{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.9.{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.9.{output-stream}; @since(version = 0.2.0) get-stderr: func() -> output-stream; diff --git a/crates/wasi/src/p2/wit/deps/clocks/monotonic-clock.wit b/crates/wasi/src/p2/wit/deps/clocks/monotonic-clock.wit index f3bc83912754..76629501d600 100644 --- a/crates/wasi/src/p2/wit/deps/clocks/monotonic-clock.wit +++ b/crates/wasi/src/p2/wit/deps/clocks/monotonic-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.9; /// 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.9.{pollable}; /// An instant in time, in nanoseconds. An instant is relative to an /// unspecified initial value, and can only be compared to instances from @@ -26,6 +26,11 @@ interface monotonic-clock { /// /// The clock is monotonic, therefore calling this function repeatedly will /// produce a sequence of non-decreasing values. + /// + /// For completeness, this function traps if it's not possible to represent + /// the value of the clock in an `instant`. Consequently, implementations + /// should ensure that the starting time is low enough to avoid the + /// possibility of overflow in practice. @since(version = 0.2.0) now: func() -> instant; diff --git a/crates/wasi/src/p2/wit/deps/clocks/timezone.wit b/crates/wasi/src/p2/wit/deps/clocks/timezone.wit index ca98ad1528cc..0528c68f01ce 100644 --- a/crates/wasi/src/p2/wit/deps/clocks/timezone.wit +++ b/crates/wasi/src/p2/wit/deps/clocks/timezone.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.9; @unstable(feature = clocks-timezone) interface timezone { diff --git a/crates/wasi/src/p2/wit/deps/clocks/wall-clock.wit b/crates/wasi/src/p2/wit/deps/clocks/wall-clock.wit index 76636a0c9b2e..b7f4c9b71257 100644 --- a/crates/wasi/src/p2/wit/deps/clocks/wall-clock.wit +++ b/crates/wasi/src/p2/wit/deps/clocks/wall-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.9; /// 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/crates/wasi/src/p2/wit/deps/clocks/world.wit b/crates/wasi/src/p2/wit/deps/clocks/world.wit index 5c53c51a154e..931b0693e3e6 100644 --- a/crates/wasi/src/p2/wit/deps/clocks/world.wit +++ b/crates/wasi/src/p2/wit/deps/clocks/world.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.6; +package wasi:clocks@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi/src/p2/wit/deps/filesystem/preopens.wit b/crates/wasi/src/p2/wit/deps/filesystem/preopens.wit index f22847940328..f8cfeed96634 100644 --- a/crates/wasi/src/p2/wit/deps/filesystem/preopens.wit +++ b/crates/wasi/src/p2/wit/deps/filesystem/preopens.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.6; +package wasi:filesystem@0.2.9; @since(version = 0.2.0) interface preopens { diff --git a/crates/wasi/src/p2/wit/deps/filesystem/types.wit b/crates/wasi/src/p2/wit/deps/filesystem/types.wit index 75c19044c726..35ecbfccccdc 100644 --- a/crates/wasi/src/p2/wit/deps/filesystem/types.wit +++ b/crates/wasi/src/p2/wit/deps/filesystem/types.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.6; +package wasi:filesystem@0.2.9; /// 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.9.{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.9.{datetime}; /// File size or length of a region within a file. @since(version = 0.2.0) diff --git a/crates/wasi/src/p2/wit/deps/filesystem/world.wit b/crates/wasi/src/p2/wit/deps/filesystem/world.wit index 65597f9f29d9..0b29bf04d4bb 100644 --- a/crates/wasi/src/p2/wit/deps/filesystem/world.wit +++ b/crates/wasi/src/p2/wit/deps/filesystem/world.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.6; +package wasi:filesystem@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi/src/p2/wit/deps/io/error.wit b/crates/wasi/src/p2/wit/deps/io/error.wit index 784f74a53e06..5f04c02047e5 100644 --- a/crates/wasi/src/p2/wit/deps/io/error.wit +++ b/crates/wasi/src/p2/wit/deps/io/error.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; @since(version = 0.2.0) interface error { @@ -8,14 +8,14 @@ interface error { /// which provides some human-readable information about the error. /// /// In the `wasi:io` package, this resource is returned through the - /// `wasi:io/streams/stream-error` type. + /// `wasi:io/streams.stream-error` type. /// /// To provide more specific error information, other interfaces may /// offer functions to "downcast" this error into more specific types. For example, /// errors returned from streams derived from filesystem types can be described using /// the filesystem's own error-code type. This is done using the function - /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow` - /// parameter and returns an `option`. + /// `wasi:filesystem/types.filesystem-error-code`, which takes a `borrow` + /// parameter and returns an `option`. /// /// The set of functions which can "downcast" an `error` into a more /// concrete type is open. diff --git a/crates/wasi/src/p2/wit/deps/io/poll.wit b/crates/wasi/src/p2/wit/deps/io/poll.wit index 7f711836c34e..96a319ae56e1 100644 --- a/crates/wasi/src/p2/wit/deps/io/poll.wit +++ b/crates/wasi/src/p2/wit/deps/io/poll.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; /// A poll API intended to let users wait for I/O events on multiple handles /// at once. diff --git a/crates/wasi/src/p2/wit/deps/io/streams.wit b/crates/wasi/src/p2/wit/deps/io/streams.wit index c5da38c862c8..c715ae31d445 100644 --- a/crates/wasi/src/p2/wit/deps/io/streams.wit +++ b/crates/wasi/src/p2/wit/deps/io/streams.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; /// 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/crates/wasi/src/p2/wit/deps/io/world.wit b/crates/wasi/src/p2/wit/deps/io/world.wit index 84c85c08ed18..d40e498b5734 100644 --- a/crates/wasi/src/p2/wit/deps/io/world.wit +++ b/crates/wasi/src/p2/wit/deps/io/world.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.6; +package wasi:io@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi/src/p2/wit/deps/random/insecure-seed.wit b/crates/wasi/src/p2/wit/deps/random/insecure-seed.wit index d3dc03a6c08e..e7fe5825dd87 100644 --- a/crates/wasi/src/p2/wit/deps/random/insecure-seed.wit +++ b/crates/wasi/src/p2/wit/deps/random/insecure-seed.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.9; /// 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/crates/wasi/src/p2/wit/deps/random/insecure.wit b/crates/wasi/src/p2/wit/deps/random/insecure.wit index d4d0284801d3..d4e28dbd8bfa 100644 --- a/crates/wasi/src/p2/wit/deps/random/insecure.wit +++ b/crates/wasi/src/p2/wit/deps/random/insecure.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.9; /// The insecure interface for insecure pseudo-random numbers. /// /// It is intended to be portable at least between Unix-family platforms and diff --git a/crates/wasi/src/p2/wit/deps/random/random.wit b/crates/wasi/src/p2/wit/deps/random/random.wit index a0ff95646a14..86a4567e383b 100644 --- a/crates/wasi/src/p2/wit/deps/random/random.wit +++ b/crates/wasi/src/p2/wit/deps/random/random.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.9; /// WASI Random is a random data API. /// /// It is intended to be portable at least between Unix-family platforms and diff --git a/crates/wasi/src/p2/wit/deps/random/world.wit b/crates/wasi/src/p2/wit/deps/random/world.wit index 099f47b36e36..05e6565d0f1f 100644 --- a/crates/wasi/src/p2/wit/deps/random/world.wit +++ b/crates/wasi/src/p2/wit/deps/random/world.wit @@ -1,4 +1,4 @@ -package wasi:random@0.2.6; +package wasi:random@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi/src/p2/wit/deps/sockets/ip-name-lookup.wit b/crates/wasi/src/p2/wit/deps/sockets/ip-name-lookup.wit index ee6419e7daff..682c331c6343 100644 --- a/crates/wasi/src/p2/wit/deps/sockets/ip-name-lookup.wit +++ b/crates/wasi/src/p2/wit/deps/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.9.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-address}; diff --git a/crates/wasi/src/p2/wit/deps/sockets/network.wit b/crates/wasi/src/p2/wit/deps/sockets/network.wit index 6ca98b63bc34..ca359ab8b29f 100644 --- a/crates/wasi/src/p2/wit/deps/sockets/network.wit +++ b/crates/wasi/src/p2/wit/deps/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.9.{error}; /// An opaque resource that represents access to (a subset of) the network. /// This enables context-based security for networking. diff --git a/crates/wasi/src/p2/wit/deps/sockets/tcp.wit b/crates/wasi/src/p2/wit/deps/sockets/tcp.wit index beefd7b465ec..51701221b4de 100644 --- a/crates/wasi/src/p2/wit/deps/sockets/tcp.wit +++ b/crates/wasi/src/p2/wit/deps/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.9.{input-stream, output-stream}; @since(version = 0.2.0) - use wasi:io/poll@0.2.6.{pollable}; + use wasi:io/poll@0.2.9.{pollable}; @since(version = 0.2.0) - use wasi:clocks/monotonic-clock@0.2.6.{duration}; + use wasi:clocks/monotonic-clock@0.2.9.{duration}; @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; diff --git a/crates/wasi/src/p2/wit/deps/sockets/udp.wit b/crates/wasi/src/p2/wit/deps/sockets/udp.wit index 9dbe6932dd14..1ed10e3cc972 100644 --- a/crates/wasi/src/p2/wit/deps/sockets/udp.wit +++ b/crates/wasi/src/p2/wit/deps/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.9.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; diff --git a/crates/wasi/src/p2/wit/deps/sockets/world.wit b/crates/wasi/src/p2/wit/deps/sockets/world.wit index e86f02cec6a2..2f856ed66496 100644 --- a/crates/wasi/src/p2/wit/deps/sockets/world.wit +++ b/crates/wasi/src/p2/wit/deps/sockets/world.wit @@ -1,4 +1,4 @@ -package wasi:sockets@0.2.6; +package wasi:sockets@0.2.9; @since(version = 0.2.0) world imports { diff --git a/crates/wasi/src/p2/wit/test.wit b/crates/wasi/src/p2/wit/test.wit index d0d29618b8d1..013357164597 100644 --- a/crates/wasi/src/p2/wit/test.wit +++ b/crates/wasi/src/p2/wit/test.wit @@ -1,13 +1,13 @@ world test-reactor { - include wasi:cli/imports@0.2.6; + include wasi:cli/imports@0.2.9; export add-strings: func(s: list) -> u32; export get-strings: func() -> list; - use wasi:io/streams@0.2.6.{output-stream}; + use wasi:io/streams@0.2.9.{output-stream}; export write-strings-to: func(o: output-stream) -> result; - use wasi:filesystem/types@0.2.6.{descriptor-stat}; + use wasi:filesystem/types@0.2.9.{descriptor-stat}; export pass-an-imported-record: func(d: descriptor-stat) -> string; } diff --git a/crates/wasi/src/p2/wit/world.wit b/crates/wasi/src/p2/wit/world.wit index c322caeecbed..4fbcc97586e7 100644 --- a/crates/wasi/src/p2/wit/world.wit +++ b/crates/wasi/src/p2/wit/world.wit @@ -2,5 +2,5 @@ package wasmtime:wasi; world bindings { - include wasi:cli/imports@0.2.6; + include wasi:cli/imports@0.2.9; } diff --git a/crates/wasi/src/p3/clocks/host.rs b/crates/wasi/src/p3/clocks/host.rs index e374c8a18f60..d750eb709d2d 100644 --- a/crates/wasi/src/p3/clocks/host.rs +++ b/crates/wasi/src/p3/clocks/host.rs @@ -1,32 +1,36 @@ use crate::clocks::WasiClocksCtxView; -use crate::p3::bindings::clocks::{monotonic_clock, wall_clock}; +use crate::p3::bindings::clocks::{monotonic_clock, system_clock}; use crate::p3::clocks::WasiClocks; use core::time::Duration; use tokio::time::sleep; use wasmtime::component::Accessor; -impl wall_clock::Host for WasiClocksCtxView<'_> { - fn now(&mut self) -> wasmtime::Result { +impl system_clock::Host for WasiClocksCtxView<'_> { + fn now(&mut self) -> wasmtime::Result { let now = self.ctx.wall_clock.now(); - Ok(wall_clock::Datetime { - seconds: now.as_secs(), + // Convert from u64 seconds (since Unix epoch) to s64 seconds + // This should always fit since we're dealing with current time + let seconds = now.as_secs() as i64; + Ok(system_clock::Instant { + seconds, nanoseconds: now.subsec_nanos(), }) } - fn get_resolution(&mut self) -> wasmtime::Result { + fn get_resolution(&mut self) -> wasmtime::Result { let res = self.ctx.wall_clock.resolution(); - Ok(wall_clock::Datetime { - seconds: res.as_secs(), - nanoseconds: res.subsec_nanos(), - }) + // Resolution is always positive, convert Duration to nanoseconds (u64) + Ok(res + .as_nanos() + .try_into() + .map_err(|_| wasmtime::Error::msg("resolution too large"))?) } } impl monotonic_clock::HostWithStore for WasiClocks { async fn wait_until( store: &Accessor, - when: monotonic_clock::Instant, + when: monotonic_clock::Mark, ) -> wasmtime::Result<()> { let clock_now = store.with(|mut view| view.get().ctx.monotonic_clock.now()); if when > clock_now { @@ -47,11 +51,11 @@ impl monotonic_clock::HostWithStore for WasiClocks { } impl monotonic_clock::Host for WasiClocksCtxView<'_> { - fn now(&mut self) -> wasmtime::Result { + fn now(&mut self) -> wasmtime::Result { Ok(self.ctx.monotonic_clock.now()) } - fn get_resolution(&mut self) -> wasmtime::Result { + fn get_resolution(&mut self) -> wasmtime::Result { Ok(self.ctx.monotonic_clock.resolution()) } } diff --git a/crates/wasi/src/p3/clocks/mod.rs b/crates/wasi/src/p3/clocks/mod.rs index 3c7ecdb58dd4..e30e2cd808fc 100644 --- a/crates/wasi/src/p3/clocks/mod.rs +++ b/crates/wasi/src/p3/clocks/mod.rs @@ -1,7 +1,7 @@ mod host; use crate::clocks::{WasiClocks, WasiClocksView}; -use crate::p3::bindings::clocks::{monotonic_clock, wall_clock}; +use crate::p3::bindings::clocks::{monotonic_clock, system_clock}; use cap_std::time::SystemTime; use wasmtime::component::Linker; @@ -59,11 +59,11 @@ where T: WasiClocksView + 'static, { monotonic_clock::add_to_linker::<_, WasiClocks>(linker, T::clocks)?; - wall_clock::add_to_linker::<_, WasiClocks>(linker, T::clocks)?; + system_clock::add_to_linker::<_, WasiClocks>(linker, T::clocks)?; Ok(()) } -impl From for wall_clock::Datetime { +impl From for system_clock::Instant { fn from( crate::clocks::Datetime { seconds, @@ -71,27 +71,28 @@ impl From for wall_clock::Datetime { }: crate::clocks::Datetime, ) -> Self { Self { - seconds, + seconds: seconds as i64, nanoseconds, } } } -impl From for crate::clocks::Datetime { +impl From for crate::clocks::Datetime { fn from( - wall_clock::Datetime { + system_clock::Instant { seconds, nanoseconds, - }: wall_clock::Datetime, + }: system_clock::Instant, ) -> Self { + // Only convert if seconds is non-negative Self { - seconds, + seconds: seconds.max(0) as u64, nanoseconds, } } } -impl TryFrom for wall_clock::Datetime { +impl TryFrom for system_clock::Instant { type Error = wasmtime::Error; fn try_from(time: SystemTime) -> Result { diff --git a/crates/wasi/src/p3/filesystem/host.rs b/crates/wasi/src/p3/filesystem/host.rs index 682fffb75259..0194748c4a7c 100644 --- a/crates/wasi/src/p3/filesystem/host.rs +++ b/crates/wasi/src/p3/filesystem/host.rs @@ -1,5 +1,5 @@ use crate::filesystem::{Descriptor, Dir, File, WasiFilesystem, WasiFilesystemCtxView}; -use crate::p3::bindings::clocks::wall_clock; +use crate::p3::bindings::clocks::system_clock; use crate::p3::bindings::filesystem::types::{ self, Advice, DescriptorFlags, DescriptorStat, DescriptorType, DirectoryEntry, ErrorCode, Filesize, MetadataHashValue, NewTimestamp, OpenFlags, PathFlags, @@ -96,10 +96,19 @@ impl AccessorExt for Accessor { } } -fn systemtime_from(t: wall_clock::Datetime) -> Result { - std::time::SystemTime::UNIX_EPOCH - .checked_add(core::time::Duration::new(t.seconds, t.nanoseconds)) - .ok_or(ErrorCode::Overflow) +fn systemtime_from(t: system_clock::Instant) -> Result { + // Handle negative seconds (times before Unix epoch) + if t.seconds < 0 { + // For negative seconds, we need to subtract the duration + let duration = core::time::Duration::new((-t.seconds) as u64, t.nanoseconds); + std::time::SystemTime::UNIX_EPOCH + .checked_sub(duration) + .ok_or(ErrorCode::Overflow) + } else { + std::time::SystemTime::UNIX_EPOCH + .checked_add(core::time::Duration::new(t.seconds as u64, t.nanoseconds)) + .ok_or(ErrorCode::Overflow) + } } fn systemtimespec_from(t: NewTimestamp) -> Result, ErrorCode> { diff --git a/crates/wasi/src/p3/wit/deps/clocks/monotonic-clock.wit b/crates/wasi/src/p3/wit/deps/clocks/monotonic-clock.wit index a91d495c6c15..7f364665a6ae 100644 --- a/crates/wasi/src/p3/wit/deps/clocks/monotonic-clock.wit +++ b/crates/wasi/src/p3/wit/deps/clocks/monotonic-clock.wit @@ -11,11 +11,11 @@ package wasi:clocks@0.3.0-rc-2025-09-16; interface monotonic-clock { use types.{duration}; - /// An instant in time, in nanoseconds. An instant is relative to an + /// A mark on a monotonic clock is a number of nanoseconds since an /// unspecified initial value, and can only be compared to instances from /// the same monotonic-clock. @since(version = 0.3.0-rc-2025-09-16) - type instant = u64; + type mark = u64; /// Read the current value of the clock. /// @@ -23,21 +23,21 @@ interface monotonic-clock { /// produce a sequence of non-decreasing values. /// /// For completeness, this function traps if it's not possible to represent - /// the value of the clock in an `instant`. Consequently, implementations + /// the value of the clock in a `mark`. Consequently, implementations /// should ensure that the starting time is low enough to avoid the /// possibility of overflow in practice. @since(version = 0.3.0-rc-2025-09-16) - now: func() -> instant; + now: func() -> mark; /// Query the resolution of the clock. Returns the duration of time /// corresponding to a clock tick. @since(version = 0.3.0-rc-2025-09-16) get-resolution: func() -> duration; - /// Wait until the specified instant has occurred. + /// Wait until the specified mark has occurred. @since(version = 0.3.0-rc-2025-09-16) wait-until: async func( - when: instant, + when: mark, ); /// Wait for the specified duration to elapse. diff --git a/crates/wasi/src/p3/wit/deps/clocks/system-clock.wit b/crates/wasi/src/p3/wit/deps/clocks/system-clock.wit new file mode 100644 index 000000000000..bd3049fd43c5 --- /dev/null +++ b/crates/wasi/src/p3/wit/deps/clocks/system-clock.wit @@ -0,0 +1,51 @@ +package wasi:clocks@0.3.0-rc-2025-09-16; +/// WASI System Clock is a clock API intended to let users query the current +/// time. The clock is not necessarily monotonic as it may be reset. +/// +/// It is intended to be portable at least between Unix-family platforms and +/// Windows. +/// +/// External references may be reset, so this clock is not necessarily +/// monotonic, making it unsuitable for measuring elapsed time. +/// +/// It is intended for reporting the current date and time for humans. +@since(version = 0.3.0-rc-2025-09-16) +interface system-clock { + use types.{duration}; + + /// An "instant", or "exact time", is a point in time without regard to any + /// time zone: just the time since a particular external reference point, + /// often called an "epoch". + /// + /// Here, the epoch is 1970-01-01T00:00:00Z, also known as + /// [POSIX's Seconds Since the Epoch], also known as [Unix Time]. + /// + /// Note that even if the seconds field is negative, incrementing + /// nanoseconds always represents moving forwards in time. + /// For example, `{ -1 seconds, 999999999 nanoseconds }` represents the + /// instant one nanosecond before the epoch. + /// For more on various different ways to represent time, see + /// https://tc39.es/proposal-temporal/docs/timezone.html + /// + /// [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 + @since(version = 0.3.0-rc-2025-09-16) + record instant { + seconds: s64, + nanoseconds: u32, + } + + /// Read the current value of the clock. + /// + /// This clock is not monotonic, therefore calling this function repeatedly + /// will not necessarily produce a sequence of non-decreasing values. + /// + /// The nanoseconds field of the output is always less than 1000000000. + @since(version = 0.3.0-rc-2025-09-16) + now: func() -> instant; + + /// Query the resolution of the clock. Returns the smallest duration of time + /// that the implementation permits distinguishing. + @since(version = 0.3.0-rc-2025-09-16) + get-resolution: func() -> duration; +} diff --git a/crates/wasi/src/p3/wit/deps/clocks/timezone.wit b/crates/wasi/src/p3/wit/deps/clocks/timezone.wit index ab8f5c0801f3..d8d5732dc123 100644 --- a/crates/wasi/src/p3/wit/deps/clocks/timezone.wit +++ b/crates/wasi/src/p3/wit/deps/clocks/timezone.wit @@ -3,53 +3,44 @@ package wasi:clocks@0.3.0-rc-2025-09-16; @unstable(feature = clocks-timezone) interface timezone { @unstable(feature = clocks-timezone) - use wall-clock.{datetime}; + use system-clock.{instant}; - /// Return information needed to display the given `datetime`. This includes - /// the UTC offset, the time zone name, and a flag indicating whether - /// daylight saving time is active. + /// Return the IANA identifier of the currently configured timezone. This + /// should be an identifier from the IANA Time Zone Database. /// - /// 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. + /// For displaying to a user, the identifier should be converted into a + /// localized name by means of an internationalization API. + /// + /// If the implementation does not expose an actual timezone, or is unable + /// to provide mappings from times to deltas between the configured timezone + /// and UTC, or determining the current timezone fails, or the timezone does + /// not have an IANA identifier, this returns nothing. @unstable(feature = clocks-timezone) - display: func(when: datetime) -> timezone-display; + iana-id: func() -> option; - /// The same as `display`, but only return the UTC offset. + /// The number of nanoseconds difference between UTC time and the local + /// time of the currently configured timezone, at the exact time of + /// `instant`. + /// + /// The magnitude of the returned value will always be less than + /// 86,400,000,000,000 which is the number of nanoseconds in a day + /// (24*60*60*1e9). + /// + /// If the implementation does not expose an actual timezone, or is unable + /// to provide mappings from times to deltas between the configured timezone + /// and UTC, or determining the current timezone fails, this returns + /// nothing. @unstable(feature = clocks-timezone) - utc-offset: func(when: datetime) -> s32; + utc-offset: func(when: instant) -> option; - /// Information useful for displaying the timezone of a specific `datetime`. + /// Returns a string that is suitable to assist humans in debugging whether + /// any timezone is available, and if so, which. This may be the same string + /// as `iana-id`, or a formatted representation of the UTC offset such as + /// `-04:00`, or something else. /// - /// This information may vary within a single `timezone` to reflect daylight - /// saving time adjustments. + /// WARNING: The returned string should not be consumed mechanically! It may + /// change across platforms, hosts, or other implementation details. Parsing + /// this string is a major platform-compatibility hazard. @unstable(feature = clocks-timezone) - record timezone-display { - /// The number of seconds difference between UTC time and the local - /// time of the timezone. - /// - /// The returned value will always be less than 86400 which is the - /// number of seconds in a day (24*60*60). - /// - /// In implementations that do not expose an actual time zone, this - /// should return 0. - utc-offset: s32, - - /// The abbreviated name of the timezone to display to a user. The name - /// `UTC` indicates Coordinated Universal Time. Otherwise, this should - /// reference local standards for the name of the time zone. - /// - /// In implementations that do not expose an actual time zone, this - /// should be the string `UTC`. - /// - /// In time zones that do not have an applicable name, a formatted - /// representation of the UTC offset may be returned, such as `-04:00`. - name: string, - - /// Whether daylight saving time is active. - /// - /// In implementations that do not expose an actual time zone, this - /// should return false. - in-daylight-saving-time: bool, - } + to-debug-string: func() -> string; } diff --git a/crates/wasi/src/p3/wit/deps/clocks/wall-clock.wit b/crates/wasi/src/p3/wit/deps/clocks/wall-clock.wit deleted file mode 100644 index ea940500faab..000000000000 --- a/crates/wasi/src/p3/wit/deps/clocks/wall-clock.wit +++ /dev/null @@ -1,46 +0,0 @@ -package wasi:clocks@0.3.0-rc-2025-09-16; -/// 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. -/// -/// It is intended to be portable at least between Unix-family platforms and -/// Windows. -/// -/// A wall clock is a clock which measures the date and time according to -/// some external reference. -/// -/// External references may be reset, so this clock is not necessarily -/// monotonic, making it unsuitable for measuring elapsed time. -/// -/// It is intended for reporting the current date and time for humans. -@since(version = 0.3.0-rc-2025-09-16) -interface wall-clock { - /// A time and date in seconds plus nanoseconds. - @since(version = 0.3.0-rc-2025-09-16) - record datetime { - seconds: u64, - nanoseconds: u32, - } - - /// Read the current value of the clock. - /// - /// This clock is not monotonic, therefore calling this function repeatedly - /// will not necessarily produce a sequence of non-decreasing values. - /// - /// The returned timestamps represent the number of seconds since - /// 1970-01-01T00:00:00Z, also known as [POSIX's Seconds Since the Epoch], - /// also known as [Unix Time]. - /// - /// The nanoseconds field of the output is always less than 1000000000. - /// - /// [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 - @since(version = 0.3.0-rc-2025-09-16) - now: func() -> datetime; - - /// Query the resolution of the clock. - /// - /// The nanoseconds field of the output is always less than 1000000000. - @since(version = 0.3.0-rc-2025-09-16) - get-resolution: func() -> datetime; -} diff --git a/crates/wasi/src/p3/wit/deps/clocks/world.wit b/crates/wasi/src/p3/wit/deps/clocks/world.wit index a6b885f07011..f274bceb0c09 100644 --- a/crates/wasi/src/p3/wit/deps/clocks/world.wit +++ b/crates/wasi/src/p3/wit/deps/clocks/world.wit @@ -5,7 +5,7 @@ world imports { @since(version = 0.3.0-rc-2025-09-16) import monotonic-clock; @since(version = 0.3.0-rc-2025-09-16) - import wall-clock; + import system-clock; @unstable(feature = clocks-timezone) import timezone; } diff --git a/crates/wasi/src/p3/wit/deps/filesystem/types.wit b/crates/wasi/src/p3/wit/deps/filesystem/types.wit index 41d91beee571..141072bdbc58 100644 --- a/crates/wasi/src/p3/wit/deps/filesystem/types.wit +++ b/crates/wasi/src/p3/wit/deps/filesystem/types.wit @@ -26,7 +26,7 @@ package wasi:filesystem@0.3.0-rc-2025-09-16; @since(version = 0.3.0-rc-2025-09-16) interface types { @since(version = 0.3.0-rc-2025-09-16) - use wasi:clocks/wall-clock@0.3.0-rc-2025-09-16.{datetime}; + use wasi:clocks/system-clock@0.3.0-rc-2025-09-16.{instant}; /// File size or length of a region within a file. @since(version = 0.3.0-rc-2025-09-16) @@ -116,17 +116,17 @@ interface types { /// /// If the `option` is none, the platform doesn't maintain an access /// timestamp for this file. - data-access-timestamp: option, + data-access-timestamp: option, /// Last data modification timestamp. /// /// If the `option` is none, the platform doesn't maintain a /// modification timestamp for this file. - data-modification-timestamp: option, + data-modification-timestamp: option, /// Last file status-change timestamp. /// /// If the `option` is none, the platform doesn't maintain a /// status-change timestamp for this file. - status-change-timestamp: option, + status-change-timestamp: option, } /// Flags determining the method of how paths are resolved. @@ -163,7 +163,7 @@ interface types { /// with the filesystem. now, /// Set the timestamp to the given value. - timestamp(datetime), + timestamp(instant), } /// A directory entry.