@@ -5,45 +5,46 @@ set -ex
5
5
generate () {
6
6
file=" $1 "
7
7
shift
8
- wit-bindgen rust wit --out-dir src --std-feature " $@ " --rustfmt \
8
+ wit-bindgen rust wit --out-dir src --std-feature " $@ " --format \
9
9
--runtime-path wit_bindgen_rt
10
10
}
11
11
12
12
# Generate the main body of the bindings which includes all imports from the two
13
13
# worlds below.
14
- generate src/bindings.rs --type-section-suffix rust-wasi-from-crates-io
14
+ generate src/bindings.rs --type-section-suffix rust-wasi-from-crates-io \
15
+ --generate-all
15
16
16
17
# Generate bindings for the `wasi:cli/command` world specifically, namely the
17
18
# macro `export_command`.
18
19
#
19
20
# Note that `--with` is used to point at the previously generated bindings.
20
- with=
" wasi:cli/[email protected] .0 =crate::cli::environment"
21
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::exit"
22
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::stdin"
23
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::stdout"
24
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::stderr"
25
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::terminal_input"
26
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::terminal_output"
27
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::terminal_stdin"
28
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::terminal_stdout"
29
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::terminal_stderr"
30
- with=
" $with ,wasi:clocks/[email protected] .0 =crate::clocks::monotonic_clock"
31
- with=
" $with ,wasi:clocks/[email protected] .0 =crate::clocks::wall_clock"
32
- with=
" $with ,wasi:filesystem/[email protected] .0 =crate::filesystem::types"
33
- with=
" $with ,wasi:filesystem/[email protected] .0 =crate::filesystem::preopens"
34
- with=
" $with ,wasi:io/[email protected] .0 =crate::io::error"
35
- with=
" $with ,wasi:io/[email protected] .0 =crate::io::poll"
36
- with=
" $with ,wasi:io/[email protected] .0 =crate::io::streams"
37
- with=
" $with ,wasi:random/[email protected] .0 =crate::random::random"
38
- with=
" $with ,wasi:random/[email protected] .0 =crate::random::insecure"
39
- with=
" $with ,wasi:random/[email protected] .0 =crate::random::insecure_seed"
40
- with=
" $with ,wasi:sockets/[email protected] .0 =crate::sockets::network"
41
- with=
" $with ,wasi:sockets/[email protected] .0 =crate::sockets::instance_network"
42
- with=
" $with ,wasi:sockets/[email protected] .0 =crate::sockets::tcp"
43
- with=
" $with ,wasi:sockets/[email protected] .0 =crate::sockets::tcp_create_socket"
44
- with=
" $with ,wasi:sockets/[email protected] .0 =crate::sockets::udp"
45
- with=
" $with ,wasi:sockets/[email protected] .0 =crate::sockets::udp_create_socket"
46
- with=
" $with ,wasi:sockets/[email protected] .0 =crate::sockets::ip_name_lookup"
21
+ with=
" wasi:cli/[email protected] .1 =crate::cli::environment"
22
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::exit"
23
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::stdin"
24
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::stdout"
25
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::stderr"
26
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::terminal_input"
27
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::terminal_output"
28
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::terminal_stdin"
29
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::terminal_stdout"
30
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::terminal_stderr"
31
+ with=
" $with ,wasi:clocks/[email protected] .1 =crate::clocks::monotonic_clock"
32
+ with=
" $with ,wasi:clocks/[email protected] .1 =crate::clocks::wall_clock"
33
+ with=
" $with ,wasi:filesystem/[email protected] .1 =crate::filesystem::types"
34
+ with=
" $with ,wasi:filesystem/[email protected] .1 =crate::filesystem::preopens"
35
+ with=
" $with ,wasi:io/[email protected] .1 =crate::io::error"
36
+ with=
" $with ,wasi:io/[email protected] .1 =crate::io::poll"
37
+ with=
" $with ,wasi:io/[email protected] .1 =crate::io::streams"
38
+ with=
" $with ,wasi:random/[email protected] .1 =crate::random::random"
39
+ with=
" $with ,wasi:random/[email protected] .1 =crate::random::insecure"
40
+ with=
" $with ,wasi:random/[email protected] .1 =crate::random::insecure_seed"
41
+ with=
" $with ,wasi:sockets/[email protected] .1 =crate::sockets::network"
42
+ with=
" $with ,wasi:sockets/[email protected] .1 =crate::sockets::instance_network"
43
+ with=
" $with ,wasi:sockets/[email protected] .1 =crate::sockets::tcp"
44
+ with=
" $with ,wasi:sockets/[email protected] .1 =crate::sockets::tcp_create_socket"
45
+ with=
" $with ,wasi:sockets/[email protected] .1 =crate::sockets::udp"
46
+ with=
" $with ,wasi:sockets/[email protected] .1 =crate::sockets::udp_create_socket"
47
+ with=
" $with ,wasi:sockets/[email protected] .1 =crate::sockets::ip_name_lookup"
47
48
generate src/command.rs \
48
49
--world wasi:cli/command \
49
50
--with " $with " \
@@ -53,17 +54,17 @@ generate src/command.rs \
53
54
--export-macro-name _export_command
54
55
55
56
# Same as the `command` world, but for the proxy world.
56
- with=
" wasi:cli/[email protected] .0 =crate::cli::stdin"
57
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::stdout"
58
- with=
" $with ,wasi:cli/[email protected] .0 =crate::cli::stderr"
59
- with=
" $with ,wasi:clocks/[email protected] .0 =crate::clocks::monotonic_clock"
60
- with=
" $with ,wasi:clocks/[email protected] .0 =crate::clocks::wall_clock"
61
- with=
" $with ,wasi:io/[email protected] .0 =crate::io::error"
62
- with=
" $with ,wasi:io/[email protected] .0 =crate::io::poll"
63
- with=
" $with ,wasi:io/[email protected] .0 =crate::io::streams"
64
- with=
" $with ,wasi:random/[email protected] .0 =crate::random::random"
65
- with=
" $with ,wasi:http/[email protected] .0 =crate::http::types"
66
- with=
" $with ,wasi:http/[email protected] .0 =crate::http::outgoing_handler"
57
+ with=
" wasi:cli/[email protected] .1 =crate::cli::stdin"
58
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::stdout"
59
+ with=
" $with ,wasi:cli/[email protected] .1 =crate::cli::stderr"
60
+ with=
" $with ,wasi:clocks/[email protected] .1 =crate::clocks::monotonic_clock"
61
+ with=
" $with ,wasi:clocks/[email protected] .1 =crate::clocks::wall_clock"
62
+ with=
" $with ,wasi:io/[email protected] .1 =crate::io::error"
63
+ with=
" $with ,wasi:io/[email protected] .1 =crate::io::poll"
64
+ with=
" $with ,wasi:io/[email protected] .1 =crate::io::streams"
65
+ with=
" $with ,wasi:random/[email protected] .1 =crate::random::random"
66
+ with=
" $with ,wasi:http/[email protected] .1 =crate::http::types"
67
+ with=
" $with ,wasi:http/[email protected] .1 =crate::http::outgoing_handler"
67
68
generate src/proxy.rs \
68
69
--world wasi:http/proxy \
69
70
--with " $with " \
0 commit comments