BurntSushi / BurntSushi/quickcheck

Build fails for target wasm32-unknown-unknown

Open
#274 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
2.8k
Forks
165
PR merge metrics
No merged PRs in 30d

Description

Compilation fails when building with `--target wasm32-unknown-unknown`.

The reason is due to an indirect dependency: `quickcheck` depends on `rand` with the `getrandom` and `small_rng` features. However, `getrandom` only supports `wasm32-unknown-unknown` if its `js` feature is specified (otherwise: the build throws an "unsupported target" error). The [solution suggested by a `rand` core team member](https://github.com/rust-random/rand/issues/991#issuecomment-771386545) is to sepect `getrandom` with the js feature explicitly.

Build error for `cargo build --target wasm32-unknown-unknown`
```
Compiling getrandom v0.2.2
error: target is not supported, for more information see: https://docs.rs/getrandom/#unsupported-targets
--> C:\Users\MaayanAdmin\.cargo\registry\src\github.com-1ecc6299db9ec823\getrandom-0.2.2\src\lib.rs:213:9
|
213 | / compile_error!("target is not supported, for more information see: \
214 | | https://docs.rs/getrandom/#unsupported-targets");
| |_________________________________________________________________________^

error[E0433]: failed to resolve: use of undeclared crate or module `imp`
--> C:\Users\MaayanAdmin\.cargo\registry\src\github.com-1ecc6299db9ec823\getrandom-0.2.2\src\lib.rs:235:5
|
235 | imp::getrandom_inner(dest)
| ^^^ use of undeclared crate or module `imp`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0433`.
error: could not compile `getrandom`
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.