Skip to content

Commit

Permalink
Merge #477
Browse files Browse the repository at this point in the history
477: Add wasm32-wasi support for V3, V4, and V5 r=kinggoesgaming a=sunfishcode

**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.

Co-authored-by: Dan Gohman <sunfish@mozilla.com>
Co-authored-by: Hunar Roop Kahlon <kinggoesgaming@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 3, 2020
2 parents 4f706fc + 519e9fe commit 58b40ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ various pieces of functionality:
`serde` crate.

You need to enable one of the following Cargo features together with
`v3`, `v4` or `v5` feature if you're targeting `wasm32` architecture:
`v3`, `v4` or `v5` feature if you're targeting `wasm32-unknown-unknown` target:

* `stdweb` - enables support for `OsRng` on `wasm32-unknown-unknown` via
`stdweb` combined with `cargo-web`
Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
//! `serde` crate.
//!
//! You need to enable one of the following Cargo features together with
//! `v3`, `v4` or `v5` feature if you're targeting `wasm32` architecture:
//! `v3`, `v4` or `v5` feature if you're targeting `wasm32-unknown-unknown`
//! target:
//!
//! * `stdweb` - enables support for `OsRng` on `wasm32-unknown-unknown` via
//! [`stdweb`] combined with [`cargo-web`]
Expand Down Expand Up @@ -160,6 +161,7 @@ mod test_util;
feature = "v3",
any(
not(target_arch = "wasm32"),
target_os = "wasi",
all(
target_arch = "wasm32",
any(feature = "stdweb", feature = "wasm-bindgen")
Expand All @@ -171,6 +173,7 @@ mod v3;
feature = "v4",
any(
not(target_arch = "wasm32"),
target_os = "wasi",
all(
target_arch = "wasm32",
any(feature = "stdweb", feature = "wasm-bindgen")
Expand All @@ -182,6 +185,7 @@ mod v4;
feature = "v5",
any(
not(target_arch = "wasm32"),
target_os = "wasi",
all(
target_arch = "wasm32",
any(feature = "stdweb", feature = "wasm-bindgen")
Expand Down

0 comments on commit 58b40ad

Please sign in to comment.