-
Notifications
You must be signed in to change notification settings - Fork 191
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
Add wasm32-wasi support for V3, V4, and V5 #477
Conversation
When the wasm32 architecture is used with WASI, md5, getrandom, and sha1 are all available, so V3, V4, and V5 can be enabled.
An update: I have been trying to get the one heck of a mess that is our build system fixed. This might take sometime to get fixed. I want a good fix not just a system held together with duct tape. I am not sure how we handle post the shift to Github Actions complete. (Travis is completely broken for us now so...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
bors r+ |
Build succeeded: |
Make it compile for wasm32-unknown-unknown and wasm32-wasi This uses the "inprocess" implementation for the WebAssembly targets, like Windows, Android and iOS already do. Note that this only compile with the master branch of the `uuid` crate, as uuid-rs/uuid#477 hasn't been published yet.
@sunfishcode added `wasm32-wasi` support in uuid-rs#477, but somewhere along the way it appears to have been broken or dropped. Thankfully, the reason for the breakage doesn't appear too deep: the `wasm-bindgen` support was enabled for all `wasm32` architectures, rather than just the `wasm32-unknown-unknown` target triple that [`wasm-bindgen` supports](https://rustwasm.github.io/wasm-bindgen/reference/rust-targets.html). This PR fixes the `cfg` expressions for `wasm-bindgen`-specific code so that they no longer catch `wasm32-wasi`, and now `wasm32-wasi` just works 🎉 To guard against future breakage, I added some `wasm32-wasi` testing infrastructure. A new CI target modeled on the `wasm-bindgen` target tests the `wasm32-wasi` implementation against `wasmtime`. Since test runners can't be specified at the command line, this requires a `.cargo/config` addition as well. I also noticed and fixed a typo in the existing `wasm-bindgen` CI target that I believe has been causing the tests to not run with any of the version features enabled.
I'm submitting a(n) feature
Description
When the wasm32 architecture is used with WASI, md5, getrandom, and sha1
are all available, so V3, V4, and V5 can be enabled.
Motivation
I'm porting an application that uses
uuid
to WASI and would like to add support.Tests
cargo test --target=wasm32-wasi --all-features
passes.