Files
Alex Crichton 247851234b Update WIT tooling used by Wasmtime (#5565)
* Update WIT tooling used by Wasmtime

This commit updates the WIT tooling, namely the wasm-tools family of
crates, with recent updates. Notably:

* bytecodealliance/wasm-tools#867
* bytecodealliance/wasm-tools#871

This updates index spaces in components and additionally bumps the
minimum required version of the component binary format to be consumed
by Wasmtime (because of the index space changes). Additionally WIT
tooling now fully supports `use`.

Note that WIT tooling doesn't, at this time, fully support packages and
depending on remotely defined WIT packages. Currently WIT still needs to
be vendored in the project. It's hoped that future work with `cargo
component` and possible integration here could make the story about
depending on remotely-defined WIT more ergonomic and streamlined.

* Fix `bindgen!` codegen tests

* Add a test for `use` paths an implement support

* Update to crates.io versions of wasm-tools

* Uncomment codegen tests
2023-01-18 15:37:03 +00:00

146 lines
2.3 KiB
Plaintext

interface variants {
enum e1 {
a,
}
e1-arg: func(x: e1)
e1-result: func() -> e1
union u1 {
u32,
float32,
}
u1-arg: func(x: u1)
u1-result: func() -> u1
record empty {}
variant v1 {
a,
b(u1),
c(e1),
d(string),
e(empty),
f,
g(u32),
}
v1-arg: func(x: v1)
v1-result: func() -> v1
bool-arg: func(x: bool)
bool-result: func() -> bool
option-arg: func(
a: option<bool>,
b: option<tuple<>>,
c: option<u32>,
d: option<e1>,
e: option<float32>,
f: option<u1>,
g: option<option<bool>>,
)
option-result: func() -> tuple<
option<bool>,
option<tuple<>>,
option<u32>,
option<e1>,
option<float32>,
option<u1>,
option<option<bool>>,
>
variant casts1 {
a(s32),
b(float32),
}
variant casts2 {
a(float64),
b(float32),
}
variant casts3 {
a(float64),
b(u64),
}
variant casts4 {
a(u32),
b(s64),
}
variant casts5 {
a(float32),
b(s64),
}
variant casts6 {
a(tuple<float32, u32>),
b(tuple<u32, u32>),
}
casts: func(
a: casts1,
b: casts2,
c: casts3,
d: casts4,
e: casts5,
f: casts6,
) -> tuple<
casts1,
casts2,
casts3,
casts4,
casts5,
casts6,
>
result-arg: func(
a: result,
b: result<_, e1>,
c: result<e1>,
d: result<tuple<>, tuple<>>,
e: result<u32, v1>,
f: result<string, list<u8>>,
)
result-result: func() -> tuple<
result,
result<_, e1>,
result<e1>,
result<tuple<>, tuple<>>,
result<u32, v1>,
result<string, list<u8>>,
>
enum my-errno {
bad1,
bad2,
}
return-result-sugar: func() -> result<s32, my-errno>
return-result-sugar2: func() -> result<_, my-errno>
return-result-sugar3: func() -> result<my-errno, my-errno>
return-result-sugar4: func() -> result<tuple<s32, u32>, my-errno>
return-option-sugar: func() -> option<s32>
return-option-sugar2: func() -> option<my-errno>
result-simple: func() -> result<u32, s32>
record is-clone {
v1: v1,
}
is-clone-arg: func(a: is-clone)
is-clone-return: func() -> is-clone
return-named-option: func() -> (a: option<u8>)
return-named-result: func() -> (a: result<u8, my-errno>)
}
default world my-world {
import imports: self.variants
export exports: self.variants
}