Skip to content

Commit 51ec9db

Browse files
authored
WASIP3 update to latest rc (#12781) (#12786)
1 parent e7e3996 commit 51ec9db

30 files changed

Lines changed: 1105 additions & 817 deletions

ci/vendor-wit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ get_github() {
3434
}
3535

3636
p2=0.2.6
37-
p3=0.3.0-rc-2026-02-09
37+
p3=0.3.0-rc-2026-03-15
3838

3939
rm -rf crates/wasi-io/wit/deps
4040
mkdir -p crates/wasi-io/wit/deps

crates/test-programs/src/bin/p3_cli_many_tasks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use test_programs::p3::wasi as wasip3;
22

3-
#[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.3.0-rc-2026-02-09")]
3+
#[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15")]
44
unsafe extern "C" {
55
#[link_name = "[async-lower]wait-for"]
66
fn wait_for(dur: u64) -> u32;

crates/test-programs/src/bin/p3_http_middleware.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ wit_bindgen::generate!({
1818
path: "../wasi-http/src/p3/wit",
1919
world: "wasi:http/middleware",
2020
with: {
21-
"wasi:http/handler@0.3.0-rc-2026-02-09": test_programs::p3::wasi::http::handler,
22-
"wasi:http/types@0.3.0-rc-2026-02-09": test_programs::p3::wasi::http::types,
23-
"wasi:http/client@0.3.0-rc-2026-02-09": test_programs::p3::wasi::http::client,
24-
"wasi:random/random@0.3.0-rc-2026-02-09": test_programs::p3::wasi::random::random,
25-
"wasi:random/insecure@0.3.0-rc-2026-02-09": test_programs::p3::wasi::random::insecure,
26-
"wasi:random/insecure-seed@0.3.0-rc-2026-02-09": test_programs::p3::wasi::random::insecure_seed,
27-
"wasi:cli/stdout@0.3.0-rc-2026-02-09": test_programs::p3::wasi::cli::stdout,
28-
"wasi:cli/stderr@0.3.0-rc-2026-02-09": test_programs::p3::wasi::cli::stderr,
29-
"wasi:cli/stdin@0.3.0-rc-2026-02-09": test_programs::p3::wasi::cli::stdin,
30-
"wasi:cli/types@0.3.0-rc-2026-02-09": test_programs::p3::wasi::cli::types,
31-
"wasi:clocks/monotonic-clock@0.3.0-rc-2026-02-09": test_programs::p3::wasi::clocks::monotonic_clock,
32-
"wasi:clocks/system-clock@0.3.0-rc-2026-02-09": test_programs::p3::wasi::clocks::system_clock,
33-
"wasi:clocks/types@0.3.0-rc-2026-02-09": test_programs::p3::wasi::clocks::types,
21+
"wasi:http/handler@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::handler,
22+
"wasi:http/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::types,
23+
"wasi:http/client@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::client,
24+
"wasi:random/random@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::random,
25+
"wasi:random/insecure@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure,
26+
"wasi:random/insecure-seed@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure_seed,
27+
"wasi:cli/stdout@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdout,
28+
"wasi:cli/stderr@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stderr,
29+
"wasi:cli/stdin@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdin,
30+
"wasi:cli/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::types,
31+
"wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::monotonic_clock,
32+
"wasi:clocks/system-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::system_clock,
33+
"wasi:clocks/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::types,
3434
},
3535
});
3636

crates/test-programs/src/bin/p3_http_middleware_with_chain.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@ mod bindings {
66
package local:local;
77
88
world middleware-with-chain {
9-
include wasi:http/service@0.3.0-rc-2026-02-09;
9+
include wasi:http/service@0.3.0-rc-2026-03-15;
1010
1111
import chain-http;
1212
}
1313
1414
interface chain-http {
15-
use wasi:http/types@0.3.0-rc-2026-02-09.{request, response, error-code};
15+
use wasi:http/types@0.3.0-rc-2026-03-15.{request, response, error-code};
1616
1717
handle: async func(request: request) -> result<response, error-code>;
1818
}
1919
",
2020
// workaround https://github.com/bytecodealliance/wit-bindgen/issues/1544
2121
// generate_all
2222
with: {
23-
"wasi:http/types@0.3.0-rc-2026-02-09": test_programs::p3::wasi::http::types,
24-
"wasi:http/client@0.3.0-rc-2026-02-09": test_programs::p3::wasi::http::client,
25-
"wasi:random/random@0.3.0-rc-2026-02-09": test_programs::p3::wasi::random::random,
26-
"wasi:random/insecure@0.3.0-rc-2026-02-09": test_programs::p3::wasi::random::insecure,
27-
"wasi:random/insecure-seed@0.3.0-rc-2026-02-09": test_programs::p3::wasi::random::insecure_seed,
28-
"wasi:cli/stdout@0.3.0-rc-2026-02-09": test_programs::p3::wasi::cli::stdout,
29-
"wasi:cli/stderr@0.3.0-rc-2026-02-09": test_programs::p3::wasi::cli::stderr,
30-
"wasi:cli/stdin@0.3.0-rc-2026-02-09": test_programs::p3::wasi::cli::stdin,
31-
"wasi:cli/types@0.3.0-rc-2026-02-09": test_programs::p3::wasi::cli::types,
32-
"wasi:clocks/monotonic-clock@0.3.0-rc-2026-02-09": test_programs::p3::wasi::clocks::monotonic_clock,
33-
"wasi:clocks/system-clock@0.3.0-rc-2026-02-09": test_programs::p3::wasi::clocks::system_clock,
34-
"wasi:clocks/types@0.3.0-rc-2026-02-09": test_programs::p3::wasi::clocks::types,
23+
"wasi:http/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::types,
24+
"wasi:http/client@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::client,
25+
"wasi:random/random@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::random,
26+
"wasi:random/insecure@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure,
27+
"wasi:random/insecure-seed@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure_seed,
28+
"wasi:cli/stdout@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdout,
29+
"wasi:cli/stderr@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stderr,
30+
"wasi:cli/stdin@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdin,
31+
"wasi:cli/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::types,
32+
"wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::monotonic_clock,
33+
"wasi:clocks/system-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::system_clock,
34+
"wasi:clocks/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::types,
3535
},
3636
});
3737

crates/test-programs/src/bin/p3_readdir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ async fn test_readdir(dir: &Descriptor) {
6262
let entries = read_dir(dir).await;
6363
assert_eq!(entries.len(), 2);
6464
assert_eq!(entries[0].name, "file");
65-
assert_eq!(entries[0].type_, DescriptorType::RegularFile);
65+
assert!(matches!(entries[0].type_, DescriptorType::RegularFile));
6666
assert_eq!(entries[1].name, "nested");
67-
assert_eq!(entries[1].type_, DescriptorType::Directory);
67+
assert!(matches!(entries[1].type_, DescriptorType::Directory));
6868

6969
assert_empty_dir(&nested).await;
7070
drop(nested);

crates/test-programs/src/bin/p3_sockets_ip_name_lookup.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,32 @@ impl test_programs::p3::exports::wasi::cli::run::Guest for Component {
6969
);
7070

7171
// Invalid inputs
72-
assert_eq!(
72+
assert!(matches!(
7373
resolve_addresses("".into()).await.unwrap_err(),
7474
ErrorCode::InvalidArgument
75-
);
76-
assert_eq!(
75+
));
76+
assert!(matches!(
7777
resolve_addresses(" ".into()).await.unwrap_err(),
7878
ErrorCode::InvalidArgument
79-
);
80-
assert_eq!(
79+
));
80+
assert!(matches!(
8181
resolve_addresses("a.b<&>".into()).await.unwrap_err(),
8282
ErrorCode::InvalidArgument
83-
);
84-
assert_eq!(
83+
));
84+
assert!(matches!(
8585
resolve_addresses("127.0.0.1:80".into()).await.unwrap_err(),
8686
ErrorCode::InvalidArgument
87-
);
88-
assert_eq!(
87+
));
88+
assert!(matches!(
8989
resolve_addresses("[::]:80".into()).await.unwrap_err(),
9090
ErrorCode::InvalidArgument
91-
);
92-
assert_eq!(
91+
));
92+
assert!(matches!(
9393
resolve_addresses("http://example.com/".into())
9494
.await
9595
.unwrap_err(),
9696
ErrorCode::InvalidArgument
97-
);
97+
));
9898
Ok(())
9999
}
100100
}

crates/test-programs/src/bin/p3_sockets_tcp_bind.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ fn test_tcp_bind_addrinuse(ip: IpAddress) {
4646
let bound_addr = sock1.get_local_address().unwrap();
4747

4848
let sock2 = TcpSocket::create(ip.family()).unwrap();
49-
assert_eq!(sock2.bind(bound_addr), Err(ErrorCode::AddressInUse));
49+
assert!(matches!(
50+
sock2.bind(bound_addr),
51+
Err(ErrorCode::AddressInUse)
52+
));
5053
}
5154

5255
// The WASI runtime should set SO_REUSEADDR for us
@@ -111,7 +114,10 @@ fn test_tcp_bind_addrnotavail(ip: IpAddress) {
111114

112115
let sock = TcpSocket::create(ip.family()).unwrap();
113116

114-
assert_eq!(sock.bind(bind_addr), Err(ErrorCode::AddressNotBindable));
117+
assert!(matches!(
118+
sock.bind(bind_addr),
119+
Err(ErrorCode::AddressNotBindable)
120+
));
115121
}
116122

117123
/// Bind should validate the address family.

crates/test-programs/src/bin/p3_sockets_tcp_connect.rs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,21 @@ async fn test_tcp_connect_unspec(family: IpAddressFamily) {
1515
let addr = IpSocketAddress::new(IpAddress::new_unspecified(family), SOME_PORT);
1616
let sock = TcpSocket::create(family).unwrap();
1717

18-
assert_eq!(sock.connect(addr).await, Err(ErrorCode::InvalidArgument));
18+
assert!(matches!(
19+
sock.connect(addr).await,
20+
Err(ErrorCode::InvalidArgument)
21+
));
1922
}
2023

2124
/// 0 is not a valid remote port.
2225
async fn test_tcp_connect_port_0(family: IpAddressFamily) {
2326
let addr = IpSocketAddress::new(IpAddress::new_loopback(family), 0);
2427
let sock = TcpSocket::create(family).unwrap();
2528

26-
assert_eq!(sock.connect(addr).await, Err(ErrorCode::InvalidArgument));
29+
assert!(matches!(
30+
sock.connect(addr).await,
31+
Err(ErrorCode::InvalidArgument)
32+
));
2733
}
2834

2935
/// Connect should validate the address family.
@@ -36,10 +42,10 @@ async fn test_tcp_connect_wrong_family(family: IpAddressFamily) {
3642

3743
let sock = TcpSocket::create(family).unwrap();
3844

39-
assert_eq!(
45+
assert!(matches!(
4046
sock.connect(remote_addr).await,
4147
Err(ErrorCode::InvalidArgument)
42-
);
48+
));
4349
}
4450

4551
/// Can only connect to unicast addresses.
@@ -52,18 +58,18 @@ async fn test_tcp_connect_non_unicast() {
5258
let sock_v4 = TcpSocket::create(IpAddressFamily::Ipv4).unwrap();
5359
let sock_v6 = TcpSocket::create(IpAddressFamily::Ipv6).unwrap();
5460

55-
assert_eq!(
61+
assert!(matches!(
5662
sock_v4.connect(ipv4_broadcast).await,
5763
Err(ErrorCode::InvalidArgument)
58-
);
59-
assert_eq!(
64+
));
65+
assert!(matches!(
6066
sock_v4.connect(ipv4_multicast).await,
6167
Err(ErrorCode::InvalidArgument)
62-
);
63-
assert_eq!(
68+
));
69+
assert!(matches!(
6470
sock_v6.connect(ipv6_multicast).await,
6571
Err(ErrorCode::InvalidArgument)
66-
);
72+
));
6773
}
6874

6975
async fn test_tcp_connect_dual_stack() {
@@ -83,15 +89,15 @@ async fn test_tcp_connect_dual_stack() {
8389
// Tests:
8490

8591
// Connecting to an IPv4 address on an IPv6 socket should fail:
86-
assert_eq!(
92+
assert!(matches!(
8793
v6_client.connect(v4_listener_addr).await,
8894
Err(ErrorCode::InvalidArgument)
89-
);
95+
));
9096
// Connecting to an IPv4-mapped-IPv6 address on an IPv6 socket should fail:
91-
assert_eq!(
97+
assert!(matches!(
9298
v6_client.connect(v6_listener_addr).await,
9399
Err(ErrorCode::InvalidArgument)
94-
);
100+
));
95101
}
96102

97103
/// Client sockets can be explicitly bound.

crates/test-programs/src/bin/p3_sockets_tcp_listen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn test_tcp_listen_with_bind(family: IpAddressFamily) {
2525
let local_addr = sock.get_local_address().unwrap();
2626

2727
assert!(matches!(sock.listen(), Ok(_)));
28-
assert_eq!(sock.get_local_address(), Ok(local_addr));
28+
assert_eq!(sock.get_local_address().unwrap(), local_addr);
2929
}
3030

3131
impl test_programs::p3::exports::wasi::cli::run::Guest for Component {

0 commit comments

Comments
 (0)