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

rand 0.6.2 is broken on wasm32-unknown-unknown #674

Closed
tomaka opened this issue Jan 4, 2019 · 4 comments
Closed

rand 0.6.2 is broken on wasm32-unknown-unknown #674

tomaka opened this issue Jan 4, 2019 · 4 comments

Comments

@tomaka
Copy link

tomaka commented Jan 4, 2019

The following line is triggered when one compiles rand on wasm32-unknown-unknown:

compile_error!("enable either wasm_bindgen or stdweb feature");

rand doesn't enable neither stdweb or wasm-bindgen in its rand_os dependency, and doesn't have any way of enabling them.

@netgusto
Copy link

netgusto commented Jan 4, 2019

I experience this problem too.

When I add the "wasm-bindgen" feature in my dependencies, like so:

[dependencies]
wasm-bindgen = "0.2"
rand = { version = "0.6", features = ["wasm-bindgen"] }

I get this error upon compilation:

the package depends on `rand`, with features: `wasm_bindgen` but `rand` does not have these features.

@dhardy
Copy link
Member

dhardy commented Jan 4, 2019

Hmm, that's what we get for moving optional dependencies... forgetting that they are also features.

You can directly depend on rand_os to enable the feature, but I guess we should fix by adding those features back to rand itself.

@ernieturner
Copy link

I seem to be running into this issue even on rand 0.6.3, but with a different error message. My dependencies are

[dependencies]
wasm-bindgen = {version = "~0.2.30", features = ["serde-serialize"]}
rand = { version = "0.6", features = ["wasm-bindgen"] }

Which works on rand 0.6.1, but on 0.6.3 when I try to compile it via cargo build --release --target wasm32-unknown-unknown I get the following

error[E0463]: can't find crate for `wasm_bindgen`
   --> /Users/ernie/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.3/src/lib.rs:729:9
    |
729 |         extern crate wasm_bindgen;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

I tried adding the rand_os line to my features array, based on some of the discussion here and in #675 but it didn't seem to change anything from what I could tell.

@dhardy
Copy link
Member

dhardy commented Jan 8, 2019

Yes, this is #682 which has an easy fix but I didn't get to it yet...

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

No branches or pull requests

4 participants