300: hook up wasi to wasmer r=lachlansneff a=MarkMcCaskey
Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
301: Add arg and env support to wasi r=lachlansneff a=lachlansneff
Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
268: add experimental virtual filesystem r=lachlansneff a=xmclark
This PR introduces some changes to the runtime and adds a new feature: virtual file system.
In the future, we may want to bundle data with our wasm apps. That data can be made available to apps in a virtual filesystem by the wasmer runtime. To do this:
- wasmer must understand custom section data
- wasmer must re-wire emscripten calls to access a virtual file system
- these features are experimental and should be guarded by a feature flag (`--features vfs`)
~This PR adds support for the `read` syscall. ~
Just kidding, this PR does a lot more. Enough syscalls were re-implemented that a code reorg was warranted.
Additions below ⬇️
Several new modules live under and around the `syscalls` module. These features are only supported on linux, but can be expanded to windows.
There are effectively two implementations: one for VFS and one for the host FS. In the future, we will have more tight control over access to the host, but this will do for now. The `select` function was also extracted into a new module as the complexity increased significantly.
`select`should be refactored in the future to use a runtime like tokio, but that will need to wait.
The introduction of the libsodium dependency introduced some stumbling blocks, so I forked the zbox project and added a new build step. See it [here](https://github.com/wasmerio/zbox/blob/bundle-libsodium/build.rs). This will build libsodium at `cargo build` time and will automatically configure the environment. This will help with adoption and it is something we may be able to give back to zbox.
Additional changes:
After review, this PR is just a bit too large. We will implement the emscripten changes in another PR. This will help accelerate the work on WASI.
Co-authored-by: Mackenzie Clark <mackenzie.a.z.c@gmail.com>