Skip to content

Commit 25ea52a

Browse files
authored
test-programs: reorganize wasi content generated by wit and remove unnecessary deps (bytecodealliance#9080)
1 parent 0077817 commit 25ea52a

File tree

18 files changed

+40
-825
lines changed

18 files changed

+40
-825
lines changed

ci/vendor-wit.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ make_vendor "wasi" "
4343
4444
4545
46-
4746
"
4847

4948
make_vendor "wasi-http" "

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use test_programs::keyvalue::wasi::keyvalue;
21
use test_programs::proxy;
3-
use test_programs::wasi::http::types::{
4-
Fields, IncomingRequest, OutgoingBody, OutgoingResponse, ResponseOutparam,
2+
use test_programs::wasi::{
3+
http::types::{Fields, IncomingRequest, OutgoingBody, OutgoingResponse, ResponseOutparam},
4+
keyvalue,
55
};
66

77
struct T;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use test_programs::config::wasi::config::runtime;
21
use test_programs::proxy;
3-
use test_programs::wasi::http::types::{
4-
Fields, IncomingRequest, OutgoingBody, OutgoingResponse, ResponseOutparam,
2+
use test_programs::wasi::{
3+
config::runtime,
4+
http::types::{Fields, IncomingRequest, OutgoingBody, OutgoingResponse, ResponseOutparam},
55
};
66

77
struct T;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use test_programs::keyvalue::wasi::keyvalue::{atomics, batch, store};
1+
use test_programs::wasi::keyvalue::{atomics, batch, store};
22

33
fn main() {
44
let bucket = store::open("").unwrap();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use test_programs::config::wasi::config::runtime;
1+
use test_programs::wasi::config::runtime;
22

33
fn main() {
44
let v = runtime::get("hello").unwrap().unwrap();

crates/test-programs/src/lib.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,23 @@ pub mod preview1;
44
pub mod sockets;
55

66
wit_bindgen::generate!({
7-
world: "test-command",
8-
path: "../wasi/wit",
7+
inline: "
8+
package wasmtime:test;
9+
10+
world test {
11+
include wasi:cli/[email protected];
12+
include wasi:config/[email protected];
13+
include wasi:keyvalue/[email protected];
14+
import wasi:http/[email protected];
15+
import wasi:http/[email protected];
16+
}
17+
",
18+
path: [
19+
"../wasi-http/wit",
20+
"../wasi-runtime-config/wit",
21+
"../wasi-keyvalue/wit",
22+
],
23+
world: "wasmtime:test/test",
924
generate_all,
1025
});
1126

@@ -30,18 +45,3 @@ pub mod proxy {
3045
},
3146
});
3247
}
33-
34-
pub mod config {
35-
wit_bindgen::generate!({
36-
path: "../wasi-runtime-config/wit",
37-
world: "wasi:config/imports",
38-
});
39-
}
40-
41-
pub mod keyvalue {
42-
wit_bindgen::generate!({
43-
path: "../wasi-keyvalue/wit",
44-
world: "wasi:keyvalue/imports",
45-
type_section_suffix: "keyvalue",
46-
});
47-
}

crates/wasi-http/wit/command-extended.wit

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

crates/wasi-http/wit/test.wit

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

crates/wasi-http/wit/world.wit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// We actually don't use this; it's just to let bindgen! find the corresponding world in wit/deps.
2+
package wasmtime:wasi-http;
3+
4+
world bindings {
5+
include wasi:http/proxy@0.2.1;
6+
}

crates/wasi-keyvalue/wit/world.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// We actually don't use this; it's just to let bindgen! find the corresponding world in wit/deps.
2-
package wasmtime:wasi;
2+
package wasmtime:wasi-keyvalue;
33

44
world bindings {
55
include wasi:keyvalue/imports@0.2.0-draft;

0 commit comments

Comments
 (0)