* Port wasi-common to io-lifetimes. This ports wasi-common from unsafe-io to io-lifetimes. Ambient authority is now indicated via calls to `ambient_authority()` from the ambient-authority crate, rather than using `unsafe` blocks. The `GetSetFdFlags::set_fd_flags` function is now split into two phases, to simplify lifetimes in implementations which need to close and re-open the underlying file. * Use posish for errno values instead of libc. This eliminates one of the few remaining direct libc dependencies. * Port to posish::io::poll. Use posish::io::poll instead of calling libc directly. This factors out more code from Wasmtime, and eliminates the need to manipulate raw file descriptors directly. And, this eliminates the last remaining direct dependency on libc in wasi-common. * Port wasi-c-api to io-lifetimes. * Update to posish 0.16.0. * Embeded NULs in filenames now get `EINVAL` instead of `EILSEQ`. * Accept either `EILSEQ` or `EINVAL` for embedded NULs. * Bump the nightly toolchain to 2021-07-12. This fixes build errors on the semver crate, which as of this writing builds with latest nightly and stable but not 2021-04-11, the old pinned version. * Have cap-std-sync re-export ambient_authority so that users get the same version.
wasi-common
A Bytecode Alliance project
A library providing a common implementation of WASI hostcalls for re-use in any WASI-enabled runtime.
The wasi-common crate will ultimately serve as a library providing a common implementation of
WASI hostcalls for re-use in any WASI (and potentially non-WASI) runtimes
such as Wasmtime and Lucet.
The library is an adaption of lucet-wasi crate from the Lucet project, and it is currently based on 40ae1df git revision.
Please note that the library requires Rust compiler version at least 1.37.0.
Supported syscalls
*nix
In our *nix implementation, we currently support the entire WASI API with the exception of socket hostcalls:
sock_recvsock_sendsock_shutdown
We expect these to be implemented when network access is standardised.
We also currently do not support the proc_raise hostcall, as it is expected to
be dropped entirely from WASI.
Windows
In our Windows implementation, we currently support the minimal subset of WASI API which allows for running the very basic "Hello world!" style WASM apps. More coming shortly, so stay tuned!
Development hints
When testing the crate, you may want to enable and run full wasm32 integration testsuite. This
requires wasm32-wasi target installed which can be done as follows using rustup
rustup target add wasm32-wasi
Now, you should be able to run the integration testsuite by running cargo test on the
test-programs package with test-programs/test_programs feature enabled:
cargo test --features test-programs/test_programs --package test-programs