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

Build fails for target wasm32-unknown-unknown #274

Open
Spoonbender opened this issue Feb 2, 2021 · 0 comments · May be fixed by #275
Open

Build fails for target wasm32-unknown-unknown #274

Spoonbender opened this issue Feb 2, 2021 · 0 comments · May be fixed by #275

Comments

@Spoonbender
Copy link

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 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`
@Spoonbender Spoonbender linked a pull request Feb 2, 2021 that will close this issue
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 a pull request may close this issue.

1 participant