Replace bulk of wasmtime-wasi with wasi-common#138
Replace bulk of wasmtime-wasi with wasi-common#138sunfishcode merged 2 commits intobytecodealliance:wasi-commonfrom kubkon:lucet-wasi
wasmtime-wasi with wasi-common#138Conversation
|
I'm curious to see what you reckon about all this @sunfishcode |
|
I've also had to update the minimum Rust version to 1.34+ as required by |
sunfishcode
left a comment
There was a problem hiding this comment.
Overall this looks good. We can figure out how to handle the js-polyfill later.
One of the changes here is that syscalls.rs no longer does wasm32<->host translation. wasi-common's APIs all use wasm32 types. I was initially concerned about this, however I'm starting to see a new way that things could work here. The majority of WASI types use fixed-size types like u32 and u64 or structs thereof, and are actually the same between the two. In fact, only __wasi_prestat_t, __wasi_iovec_t, and __wasi_ciovec_t are the only types that are about pointer/usize size.
So my idea now is that we can eventually move much of wasm32.rs and host.rs into a common file, and make the translation between the two simpler. But that doesn't need to happen right away.
| let rval = decode_exitcode(rval); | ||
|
|
||
| // TODO: Rather than call __wasi_proc_exit here, we should trigger a | ||
| // stack unwind similar to a trap. |
There was a problem hiding this comment.
Can you move this TODO comment into wasi-common?
That's an interesting idea. So how would you ideally see |
Fix memory operations with external call
Improves readability of verifier output by printing the term name of a chosen type instantiation.
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
This is a rather big set of changes so I'd rather take it step a time and thoroughly discuss before simply just merging it in (even if it's to a non-master branch).
The PR touches
wasmtime-wasiandwasmtime.rs, and features:sandboxed-system-primitivesand any dependence onbindgenwasi-commonexternal cratecurrently relies on wasi-common#missing-hostcalls branch but only until that one will be merged into master (Add stubs for unimplemented hostcalls CraneStation/wasi-common#7)does a few nastyunwrap()s but these will be cleaned as the discussion progressesEDIT: add initial todo
TODO:
unwrap()callshandle alignment check indecode_ptr