Skip to content

Commit 3461726

Browse files
authored
Update to WASI WITs 0.2.1 (bytecodealliance#9063)
No major changes happen in this release so it's just bumping version numbers. The goal here is to turn the crank and ensure that nothing else breaks as part of this release process. There's a surprising number of versions to update in-repo which we may want to make easier in the future but for now this just manually updates. It is planned that this does not actually break anyone in practice. Older runtimes should support newer versions and Wasmtime after this PR should continue to support older binaries as well. Put another way this should not break things and if it does this will get reverted and fixed. We've done our best to make sure this won't break things, so let's find out in the real world now.
1 parent b946fd6 commit 3461726

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1119
-277
lines changed

ci/vendor-wit.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ make_vendor() {
3737
cache_dir=$(mktemp -d)
3838

3939
make_vendor "wasi" "
40-
41-
42-
43-
44-
45-
46-
40+
41+
42+
43+
44+
45+
46+
4747
"
4848

4949
make_vendor "wasi-http" "
50-
51-
52-
53-
54-
55-
56-
50+
51+
52+
53+
54+
55+
56+
5757
"
5858

5959
make_vendor "wasi-runtime-config" "runtime-config@c667fe6"

crates/test-programs/src/lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ pub mod proxy {
1616
default_bindings_module: "test_programs::proxy",
1717
pub_export_macro: true,
1818
with: {
19-
"wasi:http/[email protected].0": crate::wasi::http::types,
20-
"wasi:http/[email protected].0": crate::wasi::http::outgoing_handler,
21-
"wasi:random/[email protected].0": crate::wasi::random::random,
22-
"wasi:io/[email protected].0": crate::wasi::io::error,
23-
"wasi:io/[email protected].0": crate::wasi::io::poll,
24-
"wasi:io/[email protected].0": crate::wasi::io::streams,
25-
"wasi:cli/[email protected].0": crate::wasi::cli::stdout,
26-
"wasi:cli/[email protected].0": crate::wasi::cli::stderr,
27-
"wasi:cli/[email protected].0": crate::wasi::cli::stdin,
28-
"wasi:clocks/[email protected].0": crate::wasi::clocks::monotonic_clock,
29-
"wasi:clocks/[email protected].0": crate::wasi::clocks::wall_clock,
19+
"wasi:http/[email protected].1": crate::wasi::http::types,
20+
"wasi:http/[email protected].1": crate::wasi::http::outgoing_handler,
21+
"wasi:random/[email protected].1": crate::wasi::random::random,
22+
"wasi:io/[email protected].1": crate::wasi::io::error,
23+
"wasi:io/[email protected].1": crate::wasi::io::poll,
24+
"wasi:io/[email protected].1": crate::wasi::io::streams,
25+
"wasi:cli/[email protected].1": crate::wasi::cli::stdout,
26+
"wasi:cli/[email protected].1": crate::wasi::cli::stderr,
27+
"wasi:cli/[email protected].1": crate::wasi::cli::stdin,
28+
"wasi:clocks/[email protected].1": crate::wasi::clocks::monotonic_clock,
29+
"wasi:clocks/[email protected].1": crate::wasi::clocks::wall_clock,
3030
},
3131
});
3232
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// All of the same imports and exports available in the wasi:cli/command world
22
// with addition of HTTP proxy related imports:
33
world command-extended {
4-
include wasi:cli/command@0.2.0;
5-
import wasi:http/outgoing-handler@0.2.0;
4+
include wasi:cli/command@0.2.1;
5+
import wasi:http/outgoing-handler@0.2.1;
66
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
package wasi:cli@0.2.0;
1+
package wasi:cli@0.2.1;
22

3+
@since(version = 0.2.0)
34
world command {
5+
@since(version = 0.2.0)
46
include imports;
57

8+
@since(version = 0.2.0)
69
export run;
710
}

crates/wasi-http/wit/deps/cli/environment.wit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@since(version = 0.2.0)
12
interface environment {
23
/// Get the POSIX-style environment variables.
34
///
@@ -7,12 +8,15 @@ interface environment {
78
/// Morally, these are a value import, but until value imports are available
89
/// in the component model, this import function should return the same
910
/// values each time it is called.
11+
@since(version = 0.2.0)
1012
get-environment: func() -> list<tuple<string, string>>;
1113

1214
/// Get the POSIX-style arguments to the program.
15+
@since(version = 0.2.0)
1316
get-arguments: func() -> list<string>;
1417

1518
/// Return a path that programs should use as their initial current working
1619
/// directory, interpreting `.` as shorthand for this.
20+
@since(version = 0.2.0)
1721
initial-cwd: func() -> option<string>;
1822
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
@since(version = 0.2.0)
12
interface exit {
23
/// Exit the current instance and any linked instances.
4+
@since(version = 0.2.0)
35
exit: func(status: result);
6+
7+
/// Exit the current instance and any linked instances, reporting the
8+
/// specified status code to the host.
9+
///
10+
/// The meaning of the code depends on the context, with 0 usually meaning
11+
/// "success", and other values indicating various types of failure.
12+
///
13+
/// This function does not return; the effect is analogous to a trap, but
14+
/// without the connotation that something bad has happened.
15+
@unstable(feature = cli-exit-with-code)
16+
exit-with-code: func(status-code: u8);
417
}
Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
1-
package wasi:cli@0.2.0;
1+
package wasi:cli@0.2.1;
22

3+
@since(version = 0.2.0)
34
world imports {
4-
include wasi:clocks/imports@0.2.0;
5-
include wasi:filesystem/imports@0.2.0;
6-
include wasi:sockets/imports@0.2.0;
7-
include wasi:random/imports@0.2.0;
8-
include wasi:io/imports@0.2.0;
5+
@since(version = 0.2.0)
6+
include wasi:clocks/imports@0.2.1;
7+
@since(version = 0.2.0)
8+
include wasi:filesystem/imports@0.2.1;
9+
@since(version = 0.2.0)
10+
include wasi:sockets/imports@0.2.1;
11+
@since(version = 0.2.0)
12+
include wasi:random/imports@0.2.1;
13+
@since(version = 0.2.0)
14+
include wasi:io/imports@0.2.1;
915

16+
@since(version = 0.2.0)
1017
import environment;
18+
@since(version = 0.2.0)
1119
import exit;
20+
@since(version = 0.2.0)
1221
import stdin;
22+
@since(version = 0.2.0)
1323
import stdout;
24+
@since(version = 0.2.0)
1425
import stderr;
26+
@since(version = 0.2.0)
1527
import terminal-input;
28+
@since(version = 0.2.0)
1629
import terminal-output;
30+
@since(version = 0.2.0)
1731
import terminal-stdin;
32+
@since(version = 0.2.0)
1833
import terminal-stdout;
34+
@since(version = 0.2.0)
1935
import terminal-stderr;
2036
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
@since(version = 0.2.0)
12
interface run {
23
/// Run the program.
4+
@since(version = 0.2.0)
35
run: func() -> result;
46
}
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1+
@since(version = 0.2.0)
12
interface stdin {
2-
use wasi:io/streams@0.2.0.{input-stream};
3+
@since(version = 0.2.0)
4+
use wasi:io/streams@0.2.1.{input-stream};
35

6+
@since(version = 0.2.0)
47
get-stdin: func() -> input-stream;
58
}
69

10+
@since(version = 0.2.0)
711
interface stdout {
8-
use wasi:io/streams@0.2.0.{output-stream};
12+
@since(version = 0.2.0)
13+
use wasi:io/streams@0.2.1.{output-stream};
914

15+
@since(version = 0.2.0)
1016
get-stdout: func() -> output-stream;
1117
}
1218

19+
@since(version = 0.2.0)
1320
interface stderr {
14-
use wasi:io/streams@0.2.0.{output-stream};
21+
@since(version = 0.2.0)
22+
use wasi:io/streams@0.2.1.{output-stream};
1523

24+
@since(version = 0.2.0)
1625
get-stderr: func() -> output-stream;
1726
}

crates/wasi-http/wit/deps/cli/terminal.wit

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
/// In the future, this may include functions for disabling echoing,
44
/// disabling input buffering so that keyboard events are sent through
55
/// immediately, querying supported features, and so on.
6+
@since(version = 0.2.0)
67
interface terminal-input {
78
/// The input side of a terminal.
9+
@since(version = 0.2.0)
810
resource terminal-input;
911
}
1012

@@ -13,37 +15,48 @@ interface terminal-input {
1315
/// In the future, this may include functions for querying the terminal
1416
/// size, being notified of terminal size changes, querying supported
1517
/// features, and so on.
18+
@since(version = 0.2.0)
1619
interface terminal-output {
1720
/// The output side of a terminal.
21+
@since(version = 0.2.0)
1822
resource terminal-output;
1923
}
2024

2125
/// An interface providing an optional `terminal-input` for stdin as a
2226
/// link-time authority.
27+
@since(version = 0.2.0)
2328
interface terminal-stdin {
29+
@since(version = 0.2.0)
2430
use terminal-input.{terminal-input};
2531

2632
/// If stdin is connected to a terminal, return a `terminal-input` handle
2733
/// allowing further interaction with it.
34+
@since(version = 0.2.0)
2835
get-terminal-stdin: func() -> option<terminal-input>;
2936
}
3037

3138
/// An interface providing an optional `terminal-output` for stdout as a
3239
/// link-time authority.
40+
@since(version = 0.2.0)
3341
interface terminal-stdout {
42+
@since(version = 0.2.0)
3443
use terminal-output.{terminal-output};
3544

3645
/// If stdout is connected to a terminal, return a `terminal-output` handle
3746
/// allowing further interaction with it.
47+
@since(version = 0.2.0)
3848
get-terminal-stdout: func() -> option<terminal-output>;
3949
}
4050

4151
/// An interface providing an optional `terminal-output` for stderr as a
4252
/// link-time authority.
53+
@since(version = 0.2.0)
4354
interface terminal-stderr {
55+
@since(version = 0.2.0)
4456
use terminal-output.{terminal-output};
4557

4658
/// If stderr is connected to a terminal, return a `terminal-output` handle
4759
/// allowing further interaction with it.
60+
@since(version = 0.2.0)
4861
get-terminal-stderr: func() -> option<terminal-output>;
4962
}

0 commit comments

Comments
 (0)