bazelbuild / platforms

Constraint values for specifying platforms and toolchains
Apache License 2.0
108 stars 71 forks source link

os: add WASI (WebAssembly System Interface). #19

Closed PiotrSikora closed 3 years ago

PiotrSikora commented 3 years ago

Signed-off-by: Piotr Sikora piotrsikora@google.com

katre commented 3 years ago

How would this be used? I assume this is for wasm code, to build code that runs in a browser? So the target platform would has the new :wasi constraint present?

PiotrSikora commented 3 years ago

@katre WASI is specifically designed for non-browser use cases of WebAssembly, but yeah, this is for the platform constraints. Right now, we have to carry it in rules_rust (https://github.com/bazelbuild/rules_rust/pull/477) to differentiate between wasm32-unknown-unknown and wasm32-wasi targets. Note that WASI is becoming de-facto standard, and languages other than Rust are also compiling for this target (e.g. Emscripten with STANDALONE_WASM=1).

katre commented 3 years ago

Thanks for the clarification!

katre commented 3 years ago

Are there any documentation about WASI (ideally non-rust-specific) which you could include in a comment with the new constraint?

PiotrSikora commented 3 years ago

Are there any documentation about WASI (ideally non-rust-specific) which you could include in a comment with the new constraint?

This is probably the best overview, but I'm not sure how persistent this link is going to be: https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-overview.md

Do you want me to add it?

katre commented 3 years ago

Yes please, I think that will help explain the purpose.

PiotrSikora commented 3 years ago

Done. Thanks!