Skip to content

Commit 8777909

Browse files
authored
release(wasip2): v0.2.2 (#621)
Signed-off-by: Bailey Hayes <[email protected]>
1 parent 4feaf73 commit 8777909

40 files changed

+123
-145
lines changed

wasip2/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ WASI Preview 2 contains the following APIs:
2020

2121
| Proposal | Versions |
2222
| ------------------ | -------- |
23-
| [wasi-io] | 0.2.1 |
24-
| [wasi-clocks] | 0.2.1 |
25-
| [wasi-random] | 0.2.1 |
26-
| [wasi-filesystem] | 0.2.1 |
27-
| [wasi-sockets] | 0.2.1 |
28-
| [wasi-cli] | 0.2.1 |
29-
| [wasi-http] | 0.2.1 |
23+
| [wasi-io] | 0.2.2 |
24+
| [wasi-clocks] | 0.2.2 |
25+
| [wasi-random] | 0.2.2 |
26+
| [wasi-filesystem] | 0.2.2 |
27+
| [wasi-sockets] | 0.2.2 |
28+
| [wasi-cli] | 0.2.2 |
29+
| [wasi-http] | 0.2.2 |
3030

3131
[wasi-io]: https://github.com/WebAssembly/wasi-io
3232
[wasi-clocks]: https://github.com/WebAssembly/wasi-clocks

wasip2/cli/command.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:cli@0.2.1;
1+
package wasi:cli@0.2.2;
22

33
@since(version = 0.2.0)
44
world command {

wasip2/cli/imports.wit

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
package wasi:cli@0.2.1;
1+
package wasi:cli@0.2.2;
22

33
@since(version = 0.2.0)
44
world imports {
55
@since(version = 0.2.0)
6-
include wasi:clocks/imports@0.2.1;
6+
include wasi:clocks/imports@0.2.2;
77
@since(version = 0.2.0)
8-
include wasi:filesystem/imports@0.2.1;
8+
include wasi:filesystem/imports@0.2.2;
99
@since(version = 0.2.0)
10-
include wasi:sockets/imports@0.2.1;
10+
include wasi:sockets/imports@0.2.2;
1111
@since(version = 0.2.0)
12-
include wasi:random/imports@0.2.1;
12+
include wasi:random/imports@0.2.2;
1313
@since(version = 0.2.0)
14-
include wasi:io/imports@0.2.1;
14+
include wasi:io/imports@0.2.2;
1515

1616
@since(version = 0.2.0)
1717
import environment;

wasip2/cli/stdio.wit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@since(version = 0.2.0)
22
interface stdin {
33
@since(version = 0.2.0)
4-
use wasi:io/streams@0.2.1.{input-stream};
4+
use wasi:io/streams@0.2.2.{input-stream};
55

66
@since(version = 0.2.0)
77
get-stdin: func() -> input-stream;
@@ -10,7 +10,7 @@ interface stdin {
1010
@since(version = 0.2.0)
1111
interface stdout {
1212
@since(version = 0.2.0)
13-
use wasi:io/streams@0.2.1.{output-stream};
13+
use wasi:io/streams@0.2.2.{output-stream};
1414

1515
@since(version = 0.2.0)
1616
get-stdout: func() -> output-stream;
@@ -19,7 +19,7 @@ interface stdout {
1919
@since(version = 0.2.0)
2020
interface stderr {
2121
@since(version = 0.2.0)
22-
use wasi:io/streams@0.2.1.{output-stream};
22+
use wasi:io/streams@0.2.2.{output-stream};
2323

2424
@since(version = 0.2.0)
2525
get-stderr: func() -> output-stream;

wasip2/cli/wit.lock

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

wasip2/cli/wit.toml

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

wasip2/clocks/monotonic-clock.wit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.2.1;
1+
package wasi:clocks@0.2.2;
22
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
33
/// time.
44
///
@@ -10,7 +10,7 @@ package wasi:[email protected];
1010
@since(version = 0.2.0)
1111
interface monotonic-clock {
1212
@since(version = 0.2.0)
13-
use wasi:io/poll@0.2.1.{pollable};
13+
use wasi:io/poll@0.2.2.{pollable};
1414

1515
/// An instant in time, in nanoseconds. An instant is relative to an
1616
/// unspecified initial value, and can only be compared to instances from

wasip2/clocks/timezone.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.2.1;
1+
package wasi:clocks@0.2.2;
22

33
@unstable(feature = clocks-timezone)
44
interface timezone {

wasip2/clocks/wall-clock.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.2.1;
1+
package wasi:clocks@0.2.2;
22
/// WASI Wall Clock is a clock API intended to let users query the current
33
/// time. The name "wall" makes an analogy to a "clock on the wall", which
44
/// is not necessarily monotonic as it may be reset.

wasip2/clocks/wit.lock

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

wasip2/clocks/wit.toml

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

wasip2/clocks/world.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.2.1;
1+
package wasi:clocks@0.2.2;
22

33
@since(version = 0.2.0)
44
world imports {

wasip2/filesystem/preopens.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:filesystem@0.2.1;
1+
package wasi:filesystem@0.2.2;
22

33
@since(version = 0.2.0)
44
interface preopens {

wasip2/filesystem/types.wit

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:filesystem@0.2.1;
1+
package wasi:filesystem@0.2.2;
22
/// WASI filesystem is a filesystem API primarily intended to let users run WASI
33
/// programs that access their files on their existing filesystems, without
44
/// significant overhead.
@@ -26,9 +26,9 @@ package wasi:[email protected];
2626
@since(version = 0.2.0)
2727
interface types {
2828
@since(version = 0.2.0)
29-
use wasi:io/streams@0.2.1.{input-stream, output-stream, error};
29+
use wasi:io/streams@0.2.2.{input-stream, output-stream, error};
3030
@since(version = 0.2.0)
31-
use wasi:clocks/wall-clock@0.2.1.{datetime};
31+
use wasi:clocks/wall-clock@0.2.2.{datetime};
3232

3333
/// File size or length of a region within a file.
3434
@since(version = 0.2.0)
@@ -523,12 +523,6 @@ interface types {
523523

524524
/// Open a file or directory.
525525
///
526-
/// The returned descriptor is not guaranteed to be the lowest-numbered
527-
/// descriptor not currently open/ it is randomized to prevent applications
528-
/// from depending on making assumptions about indexes, since this is
529-
/// error-prone in multi-threaded contexts. The returned descriptor is
530-
/// guaranteed to be less than 2**31.
531-
///
532526
/// If `flags` contains `descriptor-flags::mutate-directory`, and the base
533527
/// descriptor doesn't have `descriptor-flags::mutate-directory` set,
534528
/// `open-at` fails with `error-code::read-only`.

wasip2/filesystem/wit.lock

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

wasip2/filesystem/wit.toml

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

wasip2/filesystem/world.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:filesystem@0.2.1;
1+
package wasi:filesystem@0.2.2;
22

33
@since(version = 0.2.0)
44
world imports {

wasip2/http/proxy.wit

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
package wasi:http@0.2.1;
1+
package wasi:http@0.2.2;
22

33
/// The `wasi:http/imports` world imports all the APIs for HTTP proxies.
44
/// It is intended to be `include`d in other worlds.
55
@since(version = 0.2.0)
66
world imports {
77
/// HTTP proxies have access to time and randomness.
88
@since(version = 0.2.0)
9-
import wasi:clocks/monotonic-clock@0.2.1;
9+
import wasi:clocks/monotonic-clock@0.2.2;
1010
@since(version = 0.2.0)
11-
import wasi:clocks/wall-clock@0.2.1;
11+
import wasi:clocks/wall-clock@0.2.2;
1212
@since(version = 0.2.0)
13-
import wasi:random/random@0.2.1;
13+
import wasi:random/random@0.2.2;
1414

1515
/// Proxies have standard output and error streams which are expected to
1616
/// terminate in a developer-facing console provided by the host.
1717
@since(version = 0.2.0)
18-
import wasi:cli/stdout@0.2.1;
18+
import wasi:cli/stdout@0.2.2;
1919
@since(version = 0.2.0)
20-
import wasi:cli/stderr@0.2.1;
20+
import wasi:cli/stderr@0.2.2;
2121

2222
/// TODO: this is a temporary workaround until component tooling is able to
2323
/// gracefully handle the absence of stdin. Hosts must return an eof stream
2424
/// for this import, which is what wasi-libc + tooling will do automatically
2525
/// when this import is properly removed.
2626
@since(version = 0.2.0)
27-
import wasi:cli/stdin@0.2.1;
27+
import wasi:cli/stdin@0.2.2;
2828

2929
/// This is the default handler to use when user code simply wants to make an
3030
/// HTTP request (e.g., via `fetch()`).

wasip2/http/types.wit

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
@since(version = 0.2.0)
55
interface types {
66
@since(version = 0.2.0)
7-
use wasi:clocks/monotonic-clock@0.2.1.{duration};
7+
use wasi:clocks/monotonic-clock@0.2.2.{duration};
88
@since(version = 0.2.0)
9-
use wasi:io/streams@0.2.1.{input-stream, output-stream};
9+
use wasi:io/streams@0.2.2.{input-stream, output-stream};
1010
@since(version = 0.2.0)
11-
use wasi:io/error@0.2.1.{error as io-error};
11+
use wasi:io/error@0.2.2.{error as io-error};
1212
@since(version = 0.2.0)
13-
use wasi:io/poll@0.2.1.{pollable};
13+
use wasi:io/poll@0.2.2.{pollable};
1414

1515
/// This type corresponds to HTTP standard Methods.
1616
@since(version = 0.2.0)
@@ -124,12 +124,12 @@ interface types {
124124
/// setting or appending to a `fields` resource.
125125
@since(version = 0.2.0)
126126
variant header-error {
127-
/// This error indicates that a `field-key` or `field-value` was
127+
/// This error indicates that a `field-name` or `field-value` was
128128
/// syntactically invalid when used with an operation that sets headers in a
129129
/// `fields`.
130130
invalid-syntax,
131131

132-
/// This error indicates that a forbidden `field-key` was used when trying
132+
/// This error indicates that a forbidden `field-name` was used when trying
133133
/// to set a header in a `fields`.
134134
forbidden,
135135

@@ -138,8 +138,23 @@ interface types {
138138
immutable,
139139
}
140140

141+
/// Field names are always strings.
142+
///
143+
/// Field names should always be treated as case insensitive by the `fields`
144+
/// resource for the purposes of equality checking.
145+
@since(version = 0.2.1)
146+
type field-name = field-key;
147+
141148
/// Field keys are always strings.
149+
///
150+
/// Field keys should always be treated as case insensitive by the `fields`
151+
/// resource for the purposes of equality checking.
152+
///
153+
/// # Deprecation
154+
///
155+
/// This type has been deprecated in favor of the `field-name` type.
142156
@since(version = 0.2.0)
157+
@deprecated(version = 0.2.2)
143158
type field-key = string;
144159

145160
/// Field values should always be ASCII strings. However, in
@@ -171,70 +186,73 @@ interface types {
171186
///
172187
/// The resulting `fields` is mutable.
173188
///
174-
/// The list represents each key-value pair in the Fields. Keys
189+
/// The list represents each name-value pair in the Fields. Names
175190
/// which have multiple values are represented by multiple entries in this
176-
/// list with the same key.
191+
/// list with the same name.
177192
///
178-
/// The tuple is a pair of the field key, represented as a string, and
193+
/// The tuple is a pair of the field name, represented as a string, and
179194
/// Value, represented as a list of bytes.
180195
///
181-
/// An error result will be returned if any `field-key` or `field-value` is
196+
/// An error result will be returned if any `field-name` or `field-value` is
182197
/// syntactically invalid, or if a field is forbidden.
183198
@since(version = 0.2.0)
184199
from-list: static func(
185-
entries: list<tuple<field-key,field-value>>
200+
entries: list<tuple<field-name,field-value>>
186201
) -> result<fields, header-error>;
187202

188-
/// Get all of the values corresponding to a key. If the key is not present
203+
/// Get all of the values corresponding to a name. If the name is not present
189204
/// in this `fields` or is syntactically invalid, an empty list is returned.
190-
/// However, if the key is present but empty, this is represented by a list
205+
/// However, if the name is present but empty, this is represented by a list
191206
/// with one or more empty field-values present.
192207
@since(version = 0.2.0)
193-
get: func(name: field-key) -> list<field-value>;
208+
get: func(name: field-name) -> list<field-value>;
194209

195-
/// Returns `true` when the key is present in this `fields`. If the key is
210+
/// Returns `true` when the name is present in this `fields`. If the name is
196211
/// syntactically invalid, `false` is returned.
197212
@since(version = 0.2.0)
198-
has: func(name: field-key) -> bool;
213+
has: func(name: field-name) -> bool;
199214

200-
/// Set all of the values for a key. Clears any existing values for that
201-
/// key, if they have been set.
215+
/// Set all of the values for a name. Clears any existing values for that
216+
/// name, if they have been set.
202217
///
203218
/// Fails with `header-error.immutable` if the `fields` are immutable.
204219
///
205-
/// Fails with `header-error.invalid-syntax` if the `field-key` or any of
220+
/// Fails with `header-error.invalid-syntax` if the `field-name` or any of
206221
/// the `field-value`s are syntactically invalid.
207222
@since(version = 0.2.0)
208-
set: func(name: field-key, value: list<field-value>) -> result<_, header-error>;
223+
set: func(name: field-name, value: list<field-value>) -> result<_, header-error>;
209224

210-
/// Delete all values for a key. Does nothing if no values for the key
225+
/// Delete all values for a name. Does nothing if no values for the name
211226
/// exist.
212227
///
213228
/// Fails with `header-error.immutable` if the `fields` are immutable.
214229
///
215-
/// Fails with `header-error.invalid-syntax` if the `field-key` is
230+
/// Fails with `header-error.invalid-syntax` if the `field-name` is
216231
/// syntactically invalid.
217232
@since(version = 0.2.0)
218-
delete: func(name: field-key) -> result<_, header-error>;
233+
delete: func(name: field-name) -> result<_, header-error>;
219234

220-
/// Append a value for a key. Does not change or delete any existing
221-
/// values for that key.
235+
/// Append a value for a name. Does not change or delete any existing
236+
/// values for that name.
222237
///
223238
/// Fails with `header-error.immutable` if the `fields` are immutable.
224239
///
225-
/// Fails with `header-error.invalid-syntax` if the `field-key` or
240+
/// Fails with `header-error.invalid-syntax` if the `field-name` or
226241
/// `field-value` are syntactically invalid.
227242
@since(version = 0.2.0)
228-
append: func(name: field-key, value: field-value) -> result<_, header-error>;
243+
append: func(name: field-name, value: field-value) -> result<_, header-error>;
229244

230-
/// Retrieve the full set of keys and values in the Fields. Like the
231-
/// constructor, the list represents each key-value pair.
245+
/// Retrieve the full set of names and values in the Fields. Like the
246+
/// constructor, the list represents each name-value pair.
232247
///
233-
/// The outer list represents each key-value pair in the Fields. Keys
248+
/// The outer list represents each name-value pair in the Fields. Names
234249
/// which have multiple values are represented by multiple entries in this
235-
/// list with the same key.
250+
/// list with the same name.
251+
///
252+
/// The names and values are always returned in the original casing and in
253+
/// the order in which they will be serialized for transport.
236254
@since(version = 0.2.0)
237-
entries: func() -> list<tuple<field-key,field-value>>;
255+
entries: func() -> list<tuple<field-name,field-value>>;
238256

239257
/// Make a deep copy of the Fields. Equivalent in behavior to calling the
240258
/// `fields` constructor on the return value of `entries`. The resulting

wasip2/http/wit.lock

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

wasip2/http/wit.toml

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

0 commit comments

Comments
 (0)