-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update to WASI 0.2.6. #11049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Update to WASI 0.2.6. #11049
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,31 +37,31 @@ make_vendor() { | |
| cache_dir=$(mktemp -d) | ||
|
|
||
| make_vendor "wasi-io" " | ||
| [email protected].3 | ||
| [email protected].6 | ||
| " | ||
|
|
||
| make_vendor "wasi/src/p2" " | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| " | ||
|
|
||
| make_vendor "wasi-http" " | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].3 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| [email protected].6 | ||
| " | ||
|
|
||
| make_vendor "wasi-tls" " | ||
| [email protected].3 | ||
| [email protected]+d6fbdc7 | ||
| [email protected].6 | ||
| [email protected]+505fc98 | ||
| " | ||
|
|
||
| make_vendor "wasi-config" "config@f4d699b" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,8 @@ wit_bindgen::generate!({ | |
| package wasmtime:test; | ||
|
|
||
| world test { | ||
| include wasi:cli/[email protected].3; | ||
| include wasi:http/[email protected].3; | ||
| include wasi:cli/[email protected].6; | ||
| include wasi:http/[email protected].6; | ||
| include wasi:config/[email protected]; | ||
| include wasi:keyvalue/[email protected]; | ||
| include wasi:tls/[email protected]; | ||
|
|
@@ -34,17 +34,17 @@ pub mod proxy { | |
| default_bindings_module: "test_programs::proxy", | ||
| pub_export_macro: true, | ||
| with: { | ||
| "wasi:http/[email protected].3": crate::wasi::http::types, | ||
| "wasi:http/[email protected].3": crate::wasi::http::outgoing_handler, | ||
| "wasi:random/[email protected].3": crate::wasi::random::random, | ||
| "wasi:io/[email protected].3": crate::wasi::io::error, | ||
| "wasi:io/[email protected].3": crate::wasi::io::poll, | ||
| "wasi:io/[email protected].3": crate::wasi::io::streams, | ||
| "wasi:cli/[email protected].3": crate::wasi::cli::stdout, | ||
| "wasi:cli/[email protected].3": crate::wasi::cli::stderr, | ||
| "wasi:cli/[email protected].3": crate::wasi::cli::stdin, | ||
| "wasi:clocks/[email protected].3": crate::wasi::clocks::monotonic_clock, | ||
| "wasi:clocks/[email protected].3": crate::wasi::clocks::wall_clock, | ||
| "wasi:http/[email protected].6": crate::wasi::http::types, | ||
| "wasi:http/[email protected].6": crate::wasi::http::outgoing_handler, | ||
| "wasi:random/[email protected].6": crate::wasi::random::random, | ||
| "wasi:io/[email protected].6": crate::wasi::io::error, | ||
| "wasi:io/[email protected].6": crate::wasi::io::poll, | ||
| "wasi:io/[email protected].6": crate::wasi::io::streams, | ||
| "wasi:cli/[email protected].6": crate::wasi::cli::stdout, | ||
| "wasi:cli/[email protected].6": crate::wasi::cli::stderr, | ||
| "wasi:cli/[email protected].6": crate::wasi::cli::stdin, | ||
| "wasi:clocks/[email protected].6": crate::wasi::clocks::monotonic_clock, | ||
| "wasi:clocks/[email protected].6": crate::wasi::clocks::wall_clock, | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
|
|
||
| @since(version = 0.2.0) | ||
| world command { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,17 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
|
|
||
| @since(version = 0.2.0) | ||
| world imports { | ||
| @since(version = 0.2.0) | ||
| include wasi:clocks/[email protected].3; | ||
| include wasi:clocks/[email protected].6; | ||
| @since(version = 0.2.0) | ||
| include wasi:filesystem/[email protected].3; | ||
| include wasi:filesystem/[email protected].6; | ||
| @since(version = 0.2.0) | ||
| include wasi:sockets/[email protected].3; | ||
| include wasi:sockets/[email protected].6; | ||
| @since(version = 0.2.0) | ||
| include wasi:random/[email protected].3; | ||
| include wasi:random/[email protected].6; | ||
| @since(version = 0.2.0) | ||
| include wasi:io/[email protected].3; | ||
| include wasi:io/[email protected].6; | ||
|
|
||
| @since(version = 0.2.0) | ||
| import environment; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| @since(version = 0.2.0) | ||
| interface stdin { | ||
| @since(version = 0.2.0) | ||
| use wasi:io/[email protected].3.{input-stream}; | ||
| use wasi:io/[email protected].6.{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/[email protected].3.{output-stream}; | ||
| use wasi:io/[email protected].6.{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/[email protected].3.{output-stream}; | ||
| use wasi:io/[email protected].6.{output-stream}; | ||
|
|
||
| @since(version = 0.2.0) | ||
| get-stderr: func() -> output-stream; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
| /// WASI Monotonic Clock is a clock API intended to let users measure elapsed | ||
| /// time. | ||
| /// | ||
|
|
@@ -10,7 +10,7 @@ package wasi:[email protected]; | |
| @since(version = 0.2.0) | ||
| interface monotonic-clock { | ||
| @since(version = 0.2.0) | ||
| use wasi:io/[email protected].3.{pollable}; | ||
| use wasi:io/[email protected].6.{pollable}; | ||
|
|
||
| /// An instant in time, in nanoseconds. An instant is relative to an | ||
| /// unspecified initial value, and can only be compared to instances from | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
|
|
||
| @unstable(feature = clocks-timezone) | ||
| interface timezone { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
| /// 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. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
|
|
||
| @since(version = 0.2.0) | ||
| world imports { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
|
|
||
| @since(version = 0.2.0) | ||
| interface preopens { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
| /// 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:[email protected]; | |
| @since(version = 0.2.0) | ||
| interface types { | ||
| @since(version = 0.2.0) | ||
| use wasi:io/[email protected].3.{input-stream, output-stream, error}; | ||
| use wasi:io/[email protected].6.{input-stream, output-stream, error}; | ||
| @since(version = 0.2.0) | ||
| use wasi:clocks/[email protected].3.{datetime}; | ||
| use wasi:clocks/[email protected].6.{datetime}; | ||
|
|
||
| /// File size or length of a region within a file. | ||
| @since(version = 0.2.0) | ||
|
|
@@ -508,6 +508,10 @@ interface types { | |
|
|
||
| /// Create a hard link. | ||
| /// | ||
| /// Fails with `error-code::no-entry` if the old path does not exist, | ||
| /// with `error-code::exist` if the new path already exists, and | ||
| /// `error-code::not-permitted` if the old path is not a file. | ||
| /// | ||
| /// Note: This is similar to `linkat` in POSIX. | ||
| @since(version = 0.2.0) | ||
| link-at: func( | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
|
|
||
| @since(version = 0.2.0) | ||
| world imports { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,30 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
|
|
||
| /// The `wasi:http/imports` world imports all the APIs for HTTP proxies. | ||
| /// It is intended to be `include`d in other worlds. | ||
| @since(version = 0.2.0) | ||
| world imports { | ||
| /// HTTP proxies have access to time and randomness. | ||
| @since(version = 0.2.0) | ||
| import wasi:clocks/[email protected].3; | ||
| import wasi:clocks/[email protected].6; | ||
| @since(version = 0.2.0) | ||
| import wasi:clocks/[email protected].3; | ||
| import wasi:clocks/[email protected].6; | ||
| @since(version = 0.2.0) | ||
| import wasi:random/[email protected].3; | ||
| import wasi:random/[email protected].6; | ||
|
|
||
| /// 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/[email protected].3; | ||
| import wasi:cli/[email protected].6; | ||
| @since(version = 0.2.0) | ||
| import wasi:cli/[email protected].3; | ||
| import wasi:cli/[email protected].6; | ||
|
|
||
| /// 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/[email protected].3; | ||
| import wasi:cli/[email protected].6; | ||
|
|
||
| /// This is the default handler to use when user code simply wants to make an | ||
| /// HTTP request (e.g., via `fetch()`). | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,13 @@ | |
| @since(version = 0.2.0) | ||
| interface types { | ||
| @since(version = 0.2.0) | ||
| use wasi:clocks/[email protected].3.{duration}; | ||
| use wasi:clocks/[email protected].6.{duration}; | ||
| @since(version = 0.2.0) | ||
| use wasi:io/[email protected].3.{input-stream, output-stream}; | ||
| use wasi:io/[email protected].6.{input-stream, output-stream}; | ||
| @since(version = 0.2.0) | ||
| use wasi:io/[email protected].3.{error as io-error}; | ||
| use wasi:io/[email protected].6.{error as io-error}; | ||
| @since(version = 0.2.0) | ||
| use wasi:io/[email protected].3.{pollable}; | ||
| use wasi:io/[email protected].6.{pollable}; | ||
|
|
||
| /// This type corresponds to HTTP standard Methods. | ||
| @since(version = 0.2.0) | ||
|
|
@@ -170,7 +170,7 @@ interface types { | |
| /// A `fields` may be mutable or immutable. A `fields` created using the | ||
| /// constructor, `from-list`, or `clone` will be mutable, but a `fields` | ||
| /// resource given by other means (including, but not limited to, | ||
| /// `incoming-request.headers`, `outgoing-request.headers`) might be be | ||
| /// `incoming-request.headers`, `outgoing-request.headers`) might be | ||
| /// immutable. In an immutable fields, the `set`, `append`, and `delete` | ||
| /// operations will fail with `header-error.immutable`. | ||
| @since(version = 0.2.0) | ||
|
|
@@ -435,6 +435,21 @@ interface types { | |
| /// other argument to `incoming-handler.handle`. | ||
| @since(version = 0.2.0) | ||
| resource response-outparam { | ||
| /// Send an HTTP 1xx response. | ||
| /// | ||
| /// Unlike `response-outparam.set`, this does not consume the | ||
| /// `response-outparam`, allowing the guest to send an arbitrary number of | ||
| /// informational responses before sending the final response using | ||
| /// `response-outparam.set`. | ||
| /// | ||
| /// This will return an `HTTP-protocol-error` if `status` is not in the | ||
| /// range [100-199], or an `internal-error` if the implementation does not | ||
| /// support informational responses. | ||
| @unstable(feature = informational-outbound-responses) | ||
| send-informational: func( | ||
| status: u16, | ||
| headers: headers | ||
| ) -> result<_, error-code>; | ||
|
|
||
| /// Set the value of the `response-outparam` to either send a response, | ||
| /// or indicate an error. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package wasi:[email protected].3; | ||
| package wasi:[email protected].6; | ||
|
|
||
| @since(version = 0.2.0) | ||
| interface error { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.