Skip to content

Commit 3998196

Browse files
committed
Update wasi to 0.2.10
1 parent 1f67b66 commit 3998196

Some content is hidden

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

45 files changed

+921
-2775
lines changed

crates/spidermonkey-embedding-splicer/src/stub_wasi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use wit_parser::Resolve;
1515
use crate::parse_wit;
1616
use crate::wit::exports::local::spidermonkey_embedding_splicer::splicer::Feature;
1717

18-
const WASI_VERSIONS: [&str; 4] = ["0.2.0", "0.2.1", "0.2.2", "0.2.3"];
18+
const WASI_VERSIONS: [&str; 5] = ["0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.10"];
1919

2020
fn stub_wasi_imports<StubFn>(
2121
module: &mut Module,

test/api/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { now } from 'wasi:clocks/wall-clock@0.2.3';
2-
import { getRandomBytes } from 'wasi:random/random@0.2.3';
1+
import { now } from 'wasi:clocks/wall-clock@0.2.10';
2+
import { getRandomBytes } from 'wasi:random/random@0.2.10';
33

44
let result;
55
export const run = {

test/cases/http-request/source.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { handle } from 'wasi:http/outgoing-handler@0.2.3';
2-
import { Fields, OutgoingRequest } from 'wasi:http/types@0.2.3';
1+
import { handle } from 'wasi:http/outgoing-handler@0.2.10';
2+
import { Fields, OutgoingRequest } from 'wasi:http/types@0.2.10';
33

44
const encoder = new TextEncoder();
55
const decoder = new TextDecoder();

test/cases/http-server/source.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
OutgoingBody,
55
OutgoingResponse,
66
Fields,
7-
} from 'wasi:http/types@0.2.3';
7+
} from 'wasi:http/types@0.2.10';
88

99
export const incomingHandler = {
1010
handle(incomingRequest, responseOutparam) {

test/wasi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ suite('WASI', () => {
2222
const { instance } = await setupComponent({
2323
componentize: {
2424
src: `
25-
import { now } from 'wasi:clocks/wall-clock@0.2.3';
26-
import { getRandomBytes } from 'wasi:random/random@0.2.3';
25+
import { now } from 'wasi:clocks/wall-clock@0.2.10';
26+
import { getRandomBytes } from 'wasi:random/random@0.2.10';
2727
2828
let result;
2929
export const run = {

test/wit/deps/cli/command.wit

Lines changed: 0 additions & 10 deletions
This file was deleted.

test/wit/deps/cli/environment.wit

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/wit/deps/cli/exit.wit

Lines changed: 0 additions & 17 deletions
This file was deleted.

test/wit/deps/cli/imports.wit

Lines changed: 0 additions & 36 deletions
This file was deleted.

test/wit/deps/cli/package.wit

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
package wasi:cli@0.2.10;
2+
3+
@since(version = 0.2.0)
4+
interface environment {
5+
/// Get the POSIX-style environment variables.
6+
///
7+
/// Each environment variable is provided as a pair of string variable names
8+
/// and string value.
9+
///
10+
/// Morally, these are a value import, but until value imports are available
11+
/// in the component model, this import function should return the same
12+
/// values each time it is called.
13+
@since(version = 0.2.0)
14+
get-environment: func() -> list<tuple<string, string>>;
15+
16+
/// Get the POSIX-style arguments to the program.
17+
@since(version = 0.2.0)
18+
get-arguments: func() -> list<string>;
19+
20+
/// Return a path that programs should use as their initial current working
21+
/// directory, interpreting `.` as shorthand for this.
22+
@since(version = 0.2.0)
23+
initial-cwd: func() -> option<string>;
24+
}
25+
26+
@since(version = 0.2.0)
27+
interface exit {
28+
/// Exit the current instance and any linked instances.
29+
@since(version = 0.2.0)
30+
exit: func(status: result);
31+
32+
/// Exit the current instance and any linked instances, reporting the
33+
/// specified status code to the host.
34+
///
35+
/// The meaning of the code depends on the context, with 0 usually meaning
36+
/// "success", and other values indicating various types of failure.
37+
///
38+
/// This function does not return; the effect is analogous to a trap, but
39+
/// without the connotation that something bad has happened.
40+
@unstable(feature = cli-exit-with-code)
41+
exit-with-code: func(status-code: u8);
42+
}
43+
44+
@since(version = 0.2.0)
45+
interface run {
46+
/// Run the program.
47+
@since(version = 0.2.0)
48+
run: func() -> result;
49+
}
50+
51+
@since(version = 0.2.0)
52+
interface stdin {
53+
@since(version = 0.2.0)
54+
use wasi:io/streams@0.2.10.{input-stream};
55+
56+
@since(version = 0.2.0)
57+
get-stdin: func() -> input-stream;
58+
}
59+
60+
@since(version = 0.2.0)
61+
interface stdout {
62+
@since(version = 0.2.0)
63+
use wasi:io/streams@0.2.10.{output-stream};
64+
65+
@since(version = 0.2.0)
66+
get-stdout: func() -> output-stream;
67+
}
68+
69+
@since(version = 0.2.0)
70+
interface stderr {
71+
@since(version = 0.2.0)
72+
use wasi:io/streams@0.2.10.{output-stream};
73+
74+
@since(version = 0.2.0)
75+
get-stderr: func() -> output-stream;
76+
}
77+
78+
/// Terminal input.
79+
///
80+
/// In the future, this may include functions for disabling echoing,
81+
/// disabling input buffering so that keyboard events are sent through
82+
/// immediately, querying supported features, and so on.
83+
@since(version = 0.2.0)
84+
interface terminal-input {
85+
/// The input side of a terminal.
86+
@since(version = 0.2.0)
87+
resource terminal-input;
88+
}
89+
90+
/// Terminal output.
91+
///
92+
/// In the future, this may include functions for querying the terminal
93+
/// size, being notified of terminal size changes, querying supported
94+
/// features, and so on.
95+
@since(version = 0.2.0)
96+
interface terminal-output {
97+
/// The output side of a terminal.
98+
@since(version = 0.2.0)
99+
resource terminal-output;
100+
}
101+
102+
/// An interface providing an optional `terminal-input` for stdin as a
103+
/// link-time authority.
104+
@since(version = 0.2.0)
105+
interface terminal-stdin {
106+
@since(version = 0.2.0)
107+
use terminal-input.{terminal-input};
108+
109+
/// If stdin is connected to a terminal, return a `terminal-input` handle
110+
/// allowing further interaction with it.
111+
@since(version = 0.2.0)
112+
get-terminal-stdin: func() -> option<terminal-input>;
113+
}
114+
115+
/// An interface providing an optional `terminal-output` for stdout as a
116+
/// link-time authority.
117+
@since(version = 0.2.0)
118+
interface terminal-stdout {
119+
@since(version = 0.2.0)
120+
use terminal-output.{terminal-output};
121+
122+
/// If stdout is connected to a terminal, return a `terminal-output` handle
123+
/// allowing further interaction with it.
124+
@since(version = 0.2.0)
125+
get-terminal-stdout: func() -> option<terminal-output>;
126+
}
127+
128+
/// An interface providing an optional `terminal-output` for stderr as a
129+
/// link-time authority.
130+
@since(version = 0.2.0)
131+
interface terminal-stderr {
132+
@since(version = 0.2.0)
133+
use terminal-output.{terminal-output};
134+
135+
/// If stderr is connected to a terminal, return a `terminal-output` handle
136+
/// allowing further interaction with it.
137+
@since(version = 0.2.0)
138+
get-terminal-stderr: func() -> option<terminal-output>;
139+
}
140+
141+
@since(version = 0.2.0)
142+
world imports {
143+
@since(version = 0.2.0)
144+
import environment;
145+
@since(version = 0.2.0)
146+
import exit;
147+
@since(version = 0.2.0)
148+
import wasi:io/error@0.2.10;
149+
@since(version = 0.2.0)
150+
import wasi:io/poll@0.2.10;
151+
@since(version = 0.2.0)
152+
import wasi:io/streams@0.2.10;
153+
@since(version = 0.2.0)
154+
import stdin;
155+
@since(version = 0.2.0)
156+
import stdout;
157+
@since(version = 0.2.0)
158+
import stderr;
159+
@since(version = 0.2.0)
160+
import terminal-input;
161+
@since(version = 0.2.0)
162+
import terminal-output;
163+
@since(version = 0.2.0)
164+
import terminal-stdin;
165+
@since(version = 0.2.0)
166+
import terminal-stdout;
167+
@since(version = 0.2.0)
168+
import terminal-stderr;
169+
import wasi:clocks/monotonic-clock@0.2.10;
170+
import wasi:clocks/wall-clock@0.2.10;
171+
@unstable(feature = clocks-timezone)
172+
import wasi:clocks/timezone@0.2.10;
173+
import wasi:filesystem/types@0.2.10;
174+
import wasi:filesystem/preopens@0.2.10;
175+
import wasi:sockets/network@0.2.10;
176+
import wasi:sockets/instance-network@0.2.10;
177+
import wasi:sockets/udp@0.2.10;
178+
import wasi:sockets/udp-create-socket@0.2.10;
179+
import wasi:sockets/tcp@0.2.10;
180+
import wasi:sockets/tcp-create-socket@0.2.10;
181+
import wasi:sockets/ip-name-lookup@0.2.10;
182+
import wasi:random/random@0.2.10;
183+
import wasi:random/insecure@0.2.10;
184+
import wasi:random/insecure-seed@0.2.10;
185+
}
186+
@since(version = 0.2.0)
187+
world command {
188+
@since(version = 0.2.0)
189+
import environment;
190+
@since(version = 0.2.0)
191+
import exit;
192+
@since(version = 0.2.0)
193+
import wasi:io/error@0.2.10;
194+
@since(version = 0.2.0)
195+
import wasi:io/poll@0.2.10;
196+
@since(version = 0.2.0)
197+
import wasi:io/streams@0.2.10;
198+
@since(version = 0.2.0)
199+
import stdin;
200+
@since(version = 0.2.0)
201+
import stdout;
202+
@since(version = 0.2.0)
203+
import stderr;
204+
@since(version = 0.2.0)
205+
import terminal-input;
206+
@since(version = 0.2.0)
207+
import terminal-output;
208+
@since(version = 0.2.0)
209+
import terminal-stdin;
210+
@since(version = 0.2.0)
211+
import terminal-stdout;
212+
@since(version = 0.2.0)
213+
import terminal-stderr;
214+
import wasi:clocks/monotonic-clock@0.2.10;
215+
import wasi:clocks/wall-clock@0.2.10;
216+
@unstable(feature = clocks-timezone)
217+
import wasi:clocks/timezone@0.2.10;
218+
import wasi:filesystem/types@0.2.10;
219+
import wasi:filesystem/preopens@0.2.10;
220+
import wasi:sockets/network@0.2.10;
221+
import wasi:sockets/instance-network@0.2.10;
222+
import wasi:sockets/udp@0.2.10;
223+
import wasi:sockets/udp-create-socket@0.2.10;
224+
import wasi:sockets/tcp@0.2.10;
225+
import wasi:sockets/tcp-create-socket@0.2.10;
226+
import wasi:sockets/ip-name-lookup@0.2.10;
227+
import wasi:random/random@0.2.10;
228+
import wasi:random/insecure@0.2.10;
229+
import wasi:random/insecure-seed@0.2.10;
230+
231+
@since(version = 0.2.0)
232+
export run;
233+
}

0 commit comments

Comments
 (0)