Skip to content

Commit 3f6d278

Browse files
committed
Update to WASI 0.2.6.
This includes two changes: # WebAssembly/wasi-filesystem#165 Documentation update # WebAssembly/wasi-http#139 Adds a new unstable `send-informational` function to the `response-outparam` resource. I've left this `unimplemented!()`.
1 parent 41bbc45 commit 3f6d278

Some content is hidden

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

69 files changed

+228
-192
lines changed

ci/vendor-wit.sh

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

3939
make_vendor "wasi-io" "
40-
40+
4141
"
4242

4343
make_vendor "wasi/src/p2" "
44-
45-
46-
47-
48-
49-
44+
45+
46+
47+
48+
49+
5050
"
5151

5252
make_vendor "wasi-http" "
53-
54-
55-
56-
57-
58-
59-
53+
54+
55+
56+
57+
58+
59+
6060
"
6161

6262
make_vendor "wasi-tls" "
63-
64-
63+
64+
6565
"
6666

6767
make_vendor "wasi-config" "config@f4d699b"

crates/test-programs/src/lib.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ wit_bindgen::generate!({
99
package wasmtime:test;
1010
1111
world test {
12-
include wasi:cli/[email protected].3;
13-
include wasi:http/[email protected].3;
12+
include wasi:cli/[email protected].6;
13+
include wasi:http/[email protected].6;
1414
include wasi:config/[email protected];
1515
include wasi:keyvalue/[email protected];
1616
include wasi:tls/[email protected];
@@ -34,17 +34,17 @@ pub mod proxy {
3434
default_bindings_module: "test_programs::proxy",
3535
pub_export_macro: true,
3636
with: {
37-
"wasi:http/[email protected].3": crate::wasi::http::types,
38-
"wasi:http/[email protected].3": crate::wasi::http::outgoing_handler,
39-
"wasi:random/[email protected].3": crate::wasi::random::random,
40-
"wasi:io/[email protected].3": crate::wasi::io::error,
41-
"wasi:io/[email protected].3": crate::wasi::io::poll,
42-
"wasi:io/[email protected].3": crate::wasi::io::streams,
43-
"wasi:cli/[email protected].3": crate::wasi::cli::stdout,
44-
"wasi:cli/[email protected].3": crate::wasi::cli::stderr,
45-
"wasi:cli/[email protected].3": crate::wasi::cli::stdin,
46-
"wasi:clocks/[email protected].3": crate::wasi::clocks::monotonic_clock,
47-
"wasi:clocks/[email protected].3": crate::wasi::clocks::wall_clock,
37+
"wasi:http/[email protected].6": crate::wasi::http::types,
38+
"wasi:http/[email protected].6": crate::wasi::http::outgoing_handler,
39+
"wasi:random/[email protected].6": crate::wasi::random::random,
40+
"wasi:io/[email protected].6": crate::wasi::io::error,
41+
"wasi:io/[email protected].6": crate::wasi::io::poll,
42+
"wasi:io/[email protected].6": crate::wasi::io::streams,
43+
"wasi:cli/[email protected].6": crate::wasi::cli::stdout,
44+
"wasi:cli/[email protected].6": crate::wasi::cli::stderr,
45+
"wasi:cli/[email protected].6": crate::wasi::cli::stdin,
46+
"wasi:clocks/[email protected].6": crate::wasi::clocks::monotonic_clock,
47+
"wasi:clocks/[email protected].6": crate::wasi::clocks::wall_clock,
4848
},
4949
});
5050
}

crates/wasi-http/src/bindings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub use self::generated::wasi::*;
4747
pub use self::generated::exports;
4848

4949
/// Bindings to the `wasi:http/proxy` world.
50-
pub use self::generated::{Proxy, ProxyIndices, ProxyPre};
50+
pub use self::generated::{LinkOptions, Proxy, ProxyIndices, ProxyPre};
5151

5252
/// Sync implementation of the `wasi:http/proxy` world.
5353
pub mod sync {

crates/wasi-http/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,13 @@ pub fn add_only_http_to_linker_async<T>(
303303
where
304304
T: WasiHttpView + 'static,
305305
{
306+
let options = crate::bindings::LinkOptions::default(); // FIXME: Thread through to the CLI options.
306307
crate::bindings::http::outgoing_handler::add_to_linker::<_, WasiHttp<T>>(l, |x| {
307308
WasiHttpImpl(IoImpl(x))
308309
})?;
309-
crate::bindings::http::types::add_to_linker::<_, WasiHttp<T>>(l, |x| WasiHttpImpl(IoImpl(x)))?;
310+
crate::bindings::http::types::add_to_linker::<_, WasiHttp<T>>(l, &options.into(), |x| {
311+
WasiHttpImpl(IoImpl(x))
312+
})?;
310313

311314
Ok(())
312315
}
@@ -374,10 +377,11 @@ pub fn add_only_http_to_linker_sync<T>(l: &mut Linker<T>) -> anyhow::Result<()>
374377
where
375378
T: WasiHttpView + 'static,
376379
{
380+
let options = crate::bindings::LinkOptions::default(); // FIXME: Thread through to the CLI options.
377381
crate::bindings::sync::http::outgoing_handler::add_to_linker::<_, WasiHttp<T>>(l, |x| {
378382
WasiHttpImpl(IoImpl(x))
379383
})?;
380-
crate::bindings::sync::http::types::add_to_linker::<_, WasiHttp<T>>(l, |x| {
384+
crate::bindings::sync::http::types::add_to_linker::<_, WasiHttp<T>>(l, &options.into(), |x| {
381385
WasiHttpImpl(IoImpl(x))
382386
})?;
383387

crates/wasi-http/src/types_impl.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Implementation for the `wasi:http/types` interface.
22
33
use crate::{
4-
WasiHttpImpl, WasiHttpView,
4+
HttpResult, WasiHttpImpl, WasiHttpView,
55
bindings::http::types::{self, Headers, Method, Scheme, StatusCode, Trailers},
66
body::{HostFutureTrailers, HostIncomingBody, HostOutgoingBody, StreamContext},
77
types::{
@@ -580,6 +580,15 @@ where
580580
let _ = resp.result.send(val);
581581
Ok(())
582582
}
583+
584+
fn send_informational(
585+
&mut self,
586+
_id: Resource<HostResponseOutparam>,
587+
_status: u16,
588+
_headers: Resource<Headers>,
589+
) -> HttpResult<()> {
590+
unimplemented!()
591+
}
583592
}
584593

585594
impl<T> crate::bindings::http::types::HostIncomingResponse for WasiHttpImpl<T>

crates/wasi-http/wit/deps/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.3;
1+
package wasi:cli@0.2.6;
22

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

crates/wasi-http/wit/deps/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.3;
1+
package wasi:cli@0.2.6;
22

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

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

crates/wasi-http/wit/deps/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.3.{input-stream};
4+
use wasi:io/streams@0.2.6.{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.3.{output-stream};
13+
use wasi:io/streams@0.2.6.{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.3.{output-stream};
22+
use wasi:io/streams@0.2.6.{output-stream};
2323

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

crates/wasi-http/wit/deps/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.3;
1+
package wasi:clocks@0.2.6;
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.3.{pollable};
13+
use wasi:io/poll@0.2.6.{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

crates/wasi-http/wit/deps/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.3;
1+
package wasi:clocks@0.2.6;
22

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

0 commit comments

Comments
 (0)