Skip to content

Commit b84687d

Browse files
committed
Update wit-bindgen used in tests
This commit updates the `wit-bindgen` crate version used in tests from 0.13.0 and 0.16.0 to 0.32.0. A significant number of changes have happened to `wit-bindgen` in the intervening releases which relatively radically change how, for example, exported functionality works. The goal here was to get all the tests compiling/passing again with the updated version of wit-bindgen, but this otherwise doesn't refactor things too much. Note that 0.32.0 isn't the latest `wit-bindgen` because the latest version needs other changes in WIT files to replace usage of `float32` with `f32` for example. The full update here will be deferred to #3005 Signed-off-by: Alex Crichton <[email protected]>
1 parent 24b8f0a commit b84687d

File tree

34 files changed

+312
-111
lines changed

34 files changed

+312
-111
lines changed

tests/test-components/components/Cargo.lock

Lines changed: 222 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
[workspace]
22
members = ["*"]
33
exclude = ["target"]
4-
resolver = "2"
4+
resolver = "2"
5+
6+
[workspace.dependencies]
7+
wit-bindgen = "0.32.0"

tests/test-components/components/integration-spin-inbound-http/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ crate-type = ["cdylib"]
88

99
[dependencies]
1010
miniserde = "0.1.36"
11-
wit-bindgen = "0.13"
11+
wit-bindgen = { workspace = true }

tests/test-components/components/integration-spin-inbound-http/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
wit_bindgen::generate!({
22
world: "http-trigger",
33
path: "../../../../wit/deps/spin@unversioned",
4-
exports: {
5-
"fermyon:spin/inbound-http": SpinHttp,
6-
}
74
});
85

96
use std::collections::HashMap;
@@ -13,6 +10,8 @@ use miniserde::json;
1310

1411
struct SpinHttp;
1512

13+
export!(SpinHttp);
14+
1615
impl inbound_http::Guest for SpinHttp {
1716
fn handle_request(req: Request) -> Response {
1817
let (status, body) = match handle_request(req) {

tests/test-components/components/integration-wasi-http-v0.2.0-rc-2023-11-10/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ crate-type = ["cdylib"]
88

99
[dependencies]
1010
url = "2.4.0"
11-
wit-bindgen = "0.16.0"
11+
wit-bindgen = { workspace = true }

tests/test-components/components/integration-wasi-http-v0.2.0-rc-2023-11-10/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
wit_bindgen::generate!({
22
path: "../../../../wit",
33
world: "wasi:http/[email protected]",
4-
exports: {
5-
"wasi:http/[email protected]": Component
6-
}
4+
generate_all,
75
});
86

97
use {
@@ -23,6 +21,8 @@ use {
2321

2422
struct Component;
2523

24+
export!(Component);
25+
2626
impl incoming_handler::Guest for Component {
2727
fn handle(request: IncomingRequest, outparam: ResponseOutparam) {
2828
let headers = request.headers().entries();

tests/test-components/components/integration-wasi-http-v0.2.0/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ crate-type = ["cdylib"]
88

99
[dependencies]
1010
url = "2.4.0"
11-
wit-bindgen = "0.16.0"
11+
wit-bindgen = { workspace = true }

tests/test-components/components/integration-wasi-http-v0.2.0/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
wit_bindgen::generate!({
22
path: "../../../../wit",
33
world: "wasi:http/[email protected]",
4-
exports: {
5-
"wasi:http/[email protected]": Component
6-
}
4+
generate_all,
75
});
86

97
use {
@@ -23,6 +21,8 @@ use {
2321

2422
struct Component;
2523

24+
export!(Component);
25+
2626
impl incoming_handler::Guest for Component {
2727
fn handle(request: IncomingRequest, outparam: ResponseOutparam) {
2828
let headers = request.headers().entries();

tests/test-components/components/key-value/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ crate-type = ["cdylib"]
88

99
[dependencies]
1010
helper = { path = "../../helper" }
11-
wit-bindgen = "0.16.0"
11+
wit-bindgen = { workspace = true }

tests/test-components/components/key-value/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use helper::{ensure_matches, ensure_ok};
22

3-
use bindings::fermyon::spin2_0_0::key_value::{Error, Store};
3+
use helper::http_trigger_bindings::fermyon::spin2_0_0::key_value::{Error, Store};
44

55
helper::define_component!(Component);
66

0 commit comments

Comments
 (0)