Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite gen-host-wasmtime-rust to use Wasmtime's component runtime #355

Merged
merged 43 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3a2ebef
point at wasmtime in git, and turn on component-model
Oct 5, 2022
1efe956
enough fixes to get smoke import to work
Oct 6, 2022
9ee7da8
wasi mock: return ERRNO_SUCCESS in {environ|args}_{get|sizes_get}
Oct 6, 2022
4db9c8a
java component encoding: provide flags after module
Oct 6, 2022
759ca04
wasi mock: demonstrate java memory incompatibility by importing a memory
Oct 6, 2022
1f1a4ad
wasi adapter build: set stack size to 0
Oct 6, 2022
cd3aec9
gen-host-wasmtime-rust: slash and burn all adapter funcs out
Oct 6, 2022
8298fdd
ok, now smoke tests actually work
Oct 6, 2022
26b2b5b
start working on getting the `records` test to pass
Oct 7, 2022
942c10e
gen-host-wasmtime: fix return values on import funcs
Oct 7, 2022
1f1eba5
call the post return function
Oct 7, 2022
bc93c90
records tests pass for host-wasmtime-rust
Oct 7, 2022
65bd428
flags fixes landed in wasmtime main
Oct 7, 2022
eb089fb
bugfix in return types, and numbers works
Oct 10, 2022
53b3989
cargo.lock bump
Oct 10, 2022
db29c14
many-arguments test: 16 arguments is enough
Oct 10, 2022
34102ad
gen-host-wasmtime-rust: fix some ownership stuff in imports/exports f…
Oct 10, 2022
e0adcf2
lists runtime test: imports get called with owned values
Oct 10, 2022
7a31c92
move unaligned pointers test from `lists` to `invalid`
Oct 10, 2022
b109136
correctly adding a Lift derive was pretty invasive
Oct 10, 2022
e5d4312
fix
Oct 10, 2022
10009ee
unions test: add rust host
Oct 10, 2022
c4c7a99
unions tests: fix bugs in wasm.rs and host.py
Oct 10, 2022
dcce7bb
params in imports are owned, and push record derive lift logic down i…
Oct 11, 2022
76811bf
test fixes
Oct 11, 2022
1056d26
rebase fixes
Oct 11, 2022
bee04d6
many arguments codegen test: reduce to 16 arguments
Oct 11, 2022
720aa06
runtime_tests_wasmtime: pass components in
Oct 11, 2022
1b90ee3
made a branch for catching invalid lifts
Oct 11, 2022
a31b7f8
found a bug with post_return calling
Oct 11, 2022
fc74ac8
invalid: here are some more error messages
Oct 11, 2022
add8f14
back out "fix" to oob trapping semantics
Oct 11, 2022
2f548bf
invalid test: cant re-enter instance after a trap, so make a new store
Oct 11, 2022
1f26f5f
host-wasmtime-rust is just a shim to export anyhow, wasmtime, & the p…
Oct 11, 2022
95ea14c
invalid/host.py: create a new store to reset
Oct 11, 2022
73a11be
code review
Oct 12, 2022
847ea03
code review: remove custom_error config, and add tracing impl for imp…
Oct 12, 2022
20ad30a
enable tracing in host-wasmtime-rust tests
Oct 12, 2022
eb82375
invalid test: disable (by commenting out) the unaligned memory test f…
Oct 12, 2022
e701dc7
Merge remote-tracking branch 'origin/main' into host-wasmtime-rust
Oct 12, 2022
295a404
many arguments host.ts: i have no idea why this fixes broken CI, but …
Oct 12, 2022
d65c215
latest main has fix required for wasmtime's treatment of export types
Oct 12, 2022
7a2343e
wit-bindgen-demo: remove support for wasmtime custom error
Oct 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
436 changes: 254 additions & 182 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pulldown-cmark = { version = "0.8", default-features = false }
clap = { version = "4.0.9", features = ["derive"] }
env_logger = "0.9.1"

wasmtime = "1.0"
wasmtime-wasi = "1.0"
wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", branch = "main" , features = ["component-model"] }
wasmtime-wasi = { git = "https://github.com/bytecodealliance/wasmtime", branch = "main" }
wasmprinter = "0.2.41"
wasmparser = "0.92.0"
wasm-encoder = "0.18.0"
Expand Down
8 changes: 4 additions & 4 deletions crates/gen-guest-rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl Generator for RustWasm {
record: &Record,
docs: &Docs,
) {
self.print_typedef_record(iface, id, record, docs);
self.print_typedef_record(iface, id, record, docs, false);
}

fn type_tuple(
Expand Down Expand Up @@ -254,7 +254,7 @@ impl Generator for RustWasm {
variant: &Variant,
docs: &Docs,
) {
self.print_typedef_variant(iface, id, variant, docs);
self.print_typedef_variant(iface, id, variant, docs, false);
}

fn type_union(
Expand All @@ -265,7 +265,7 @@ impl Generator for RustWasm {
union: &Union,
docs: &Docs,
) {
self.print_typedef_union(iface, id, union, docs);
self.print_typedef_union(iface, id, union, docs, false);
}

fn type_option(
Expand All @@ -291,7 +291,7 @@ impl Generator for RustWasm {
}

fn type_enum(&mut self, _iface: &Interface, id: TypeId, name: &str, enum_: &Enum, docs: &Docs) {
self.print_typedef_enum(id, name, enum_, docs);
self.print_typedef_enum(id, name, enum_, docs, &[], Box::new(|_| String::new()));
}

fn type_alias(&mut self, iface: &Interface, id: TypeId, _name: &str, ty: &Type, docs: &Docs) {
Expand Down
4 changes: 4 additions & 0 deletions crates/gen-host-wasmtime-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ test-helpers = { path = '../test-helpers' }
wasmtime = { workspace = true }
wasmtime-wasi = { workspace = true }
wit-bindgen-host-wasmtime-rust = { workspace = true, features = ['tracing'] }

tracing = { version = "0.1.26" }
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"]}
test-log = { version = "0.2", default-features = false, features = ['trace'] }
Loading