Skip to content
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

feat(std/wasi) add wasi_snapshot_preview1 #6441

Merged
merged 8 commits into from
Jun 24, 2020
Merged

Conversation

caspervonb
Copy link
Contributor

This brings in an implementation of the latest snapshot of the WebAssembly System Interface (WASI) ABI which is wasi_snapshot_preview1 cut from caspervonb/deno-wasi@23f39bd.

Closes #3005

@caspervonb
Copy link
Contributor Author

LGTM; thanks @ry 😁

fn main() {
let args = std::env::args();
assert_eq!(args.len(), 3);
}
Copy link
Member

@ry ry Jun 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could build this as part of the deno cargo workspace rather than during the running of "cargo test std_tests"

Imagine having std/wasi/testdata/Cargo.toml

[build]
target = "wasm32-wasi"

[[bin]]
name = "std_env_args"
path = "./std_env_args.rs"

[[bin]]
name = "std_env_vars"
path = "./std_env_vars.rs"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[build]
target = "wasm32-wasi"

This doesn't work unfortunately, the default target goes in .cargo/config of the workspace as far as I know, not sure if it can be overriden at any arbritrary level of .cargo files or if its the top level workspace only.

Also by default; the build ends up in deno/target/<debug|release> which seems to again be a .cargo/config thing.

Besides that I'm not sure if Cargo manifests are capable of expressing the future scenario of "build these files with that ABI into this folder, and then again with that other ABI into that folder".

I guess we could rewrite the build script in Rust so it runs during cargo build.

[package]
# ...
build = "build.rs"

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thank you much @caspervonb ! This is a great addition to std, and I'm hopeful that we can start doing full integration benchmarks where we see how what sort of slow down native programs have vs running in deno under wasi.

@ry ry merged commit a354b24 into denoland:master Jun 24, 2020
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 21, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Feb 1, 2021
@caspervonb caspervonb deleted the std-wasi branch May 24, 2021 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WASI support for Webassembly
3 participants