Allow using WASI APIs in the Python extension (#533)

* Allow using WASI APIs in the Python extension

This commit adds support to the Python extension to load the WASI
implementation when a WASI module is seen allowing Python to load
WebAssembly modules that use WASI. This is pretty primitive right now
because there's no way to configure the environment/args/preopens/etc,
but it's hoped to be at least a start!

* rustfmt

* Refactor checks for the wasi module name

* Move the check into `wasmtime-wasi` itself
* Make it conservative for now and match anything that says `wasi*`
* Leave a `FIXME` for improving this later on

* Enable missing feature of winapi for `winx`
This commit is contained in:
Alex Crichton
2019-11-11 13:09:45 -06:00
committed by Dan Gohman
parent 0006a2af95
commit d9edb95218
6 changed files with 54 additions and 16 deletions

View File

@@ -4,3 +4,10 @@ mod instantiate;
mod syscalls;
pub use instantiate::{instantiate_wasi, instantiate_wasi_with_context};
pub fn is_wasi_module(name: &str) -> bool {
// FIXME: this should be more conservative, but while WASI is in flux and
// we're figuring out how to support multiple revisions, this should do the
// trick.
name.starts_with("wasi")
}