Provide the C WASI implementation as an option.#157
Merged
kubkon merged 2 commits intowasi-commonfrom May 21, 2019
Merged
Conversation
This adds the C WASI implementation as a new crate, wasmtime-wasi-c, and adds a command-line flag to the wasmtime command-line driver to select which WASI implementation to use.
Member
|
Overall looks good to me. One thing though. How about we put the C version behind a target dependency, so that we don't have to disable it manually whenever we want to build wasmtime on Windows? I was thinking of something along the lines of: let wasi = if args.flag_wasi_common {
instantiate_wasi("", global_exports, &preopen_dirs, &argv, &environ)
} else {
#[cfg(unix)]
{
wasmtime_wasi_c::instantiate_wasi_c("", global_exports, &preopen_dirs, &argv, &environ)
}
#[cfg(not(unix))]
{
unimplemented!("wasmtime-wasi-c requires a *nix")
}
}
.expect("instantiating wasi");and in |
Member
Author
|
Makes sense. I've now made this change. |
Member
|
Looks great, thanks! |
kubkon
pushed a commit
that referenced
this pull request
Nov 7, 2019
If someone somehow defines more preopens than can fit in the `__wasi_fd_t` index space, we should detect it instead of silently wrapping around.
dhil
added a commit
to dhil/wasmtime
that referenced
this pull request
Apr 15, 2024
avanhatt
pushed a commit
to wellesley-prog-sys/wasmtime
that referenced
this pull request
Oct 18, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the C WASI implementation as a new crate, wasmtime-wasi-c,
and adds a command-line flag to the wasmtime command-line driver to
select which WASI implementation to use.
This will make it easier to test the C and Rust versions against each other. I'm finding this useful as I'm debugging the test failures in wasi-common. When we're ready to enable wasi-common by default, we can maybe put the C version behind a feature flag so that it doesn't get built by default (and we don't need the C dependencies by default) and keep it around as long as it's useful.