-
Notifications
You must be signed in to change notification settings - Fork 633
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
Circular dependency with rand #1489
Comments
I still get circular dependency errors even when I nuke all the features: [dependencies.futures-util-preview]
version = "0.3.0-alpha.13"
default-features = false
[dependencies.futures-executor-preview]
version = "0.3.0-alpha.13"
default-features = false
[dependencies.futures-test-preview]
version = "0.3.0-alpha.13"
default-features = false
[dependencies.futures-core-preview]
version = "0.3.0-alpha.13"
default-features = false
[dependencies.futures-channel-preview]
version = "0.3.0-alpha.13"
default-features = false
[dependencies.futures-io-preview]
version = "0.3.0-alpha.13"
default-features = false
[dependencies.futures-sink-preview]
version = "0.3.0-alpha.13"
default-features = false
[dependencies.futures-preview]
version = "0.3.0-alpha.13"
default-features = false I'm surprised, I was expecting that using |
Perhaps, we need to implement our own PRNG, like rayon (rayon-rs/rayon#571). EDIT: |
The problem isn’t the PRNG implementation, it’s using the thread local PRNG from |
|
@Nemo157 Does it? I see this: It doesn't seem to explicitly activate any features at all. |
Since it doesn’t have |
So... you're saying if I have a dependency, and that dependency does not use |
Yep and yep. |
Thanks for the explanation! Well, that honestly seems like a Cargo bug! In any case, that's outside of this bug report. |
Actually, looking into The "easiest" solution I see to this (that retains full support for One option to help from the |
I've contributed significantly to stdweb, I'll see how feasible that is. |
Thanks to #1555, this issue is temporarily fixed (assuming you don't use the |
Here is a reduced test case:
When I run
cargo build
I get this error:After scratching my head at this for quite a while, I figured it out:
The
rand
crate has optional support for generating random numbers on wasm32 (that's what thestdweb
feature enables).The
stdweb
crate has optional support for using JS Promises as Futures (that's what theexperimental_features_which_may_break_on_minor_version_bumps
feature enables).The
futures_util
crate has non-optional support for usingrand
(this is used for theselect
macro).This then creates a cycle:
futures_util
needsrand
, which needsstdweb
, which needsfutures_util
.I don't have any great solutions for this. Removing
rand
from thestd
feature will fix the immediate problem, but then what if somebody wants to use theselect
macro...?The text was updated successfully, but these errors were encountered: