-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Replace bulk of wasmtime-wasi
with wasi-common
#138
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this TODO comment into wasi-common?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in CraneStation/wasi-common#14 :-)
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.
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-wasi
andwasmtime.rs
, and features:sandboxed-system-primitives
and any dependence onbindgen
wasi-common
external 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