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

Updating to rand 0.6.2 breaks build #675

Closed
dignifiedquire opened this issue Jan 4, 2019 · 5 comments
Closed

Updating to rand 0.6.2 breaks build #675

dignifiedquire opened this issue Jan 4, 2019 · 5 comments

Comments

@dignifiedquire
Copy link

I just ran cargo update which updated from rand 0.6.1 to 0.6.2 and now my build is failing with

error[E0432]: unresolved import `rand_os`
   --> /Users/dignifiedquire/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.2/src/rngs/mod.rs:182:9
    |
182 | pub use rand_os::OsRng;
    |         ^^^^^^^ maybe a missing `extern crate rand_os;`?

both with nightly and stable

$ rustc --version
rustc 1.32.0-nightly (14997d56a 2018-12-05)
$ rustc +stable --version
rustc 1.31.0 (abe02cefd 2018-12-04)
@dignifiedquire dignifiedquire changed the title updating to rand 0.6.2 breaks Updating to rand 0.6.2 breaks build Jan 4, 2019
@dhardy
Copy link
Member

dhardy commented Jan 4, 2019

Hmm, rand_os was published first (crate), so I wonder why this happens? Can't reproduce in my little test program.

@dignifiedquire
Copy link
Author

it happens on a fresh clone of https://github.com/dignifiedquire/rpgp for me, maybe because the root pulls in 0.5 and a dependency uses 0.6?

@dhardy
Copy link
Member

dhardy commented Jan 4, 2019

No, I think it's because we confused our crate options. We have a rand_os feature and a std feature, and std implicitly requires rand_os. Both are enabled by default so to hit this case you must have disabled default features but then enabled std.

I'll make std depend on rand_os, but you can work around this by depending directly on that (or using default features). I can't promise rand will always have a rand_os feature however.

Reproduce with: cargo test --no-default-features --tests --features std

@dignifiedquire
Copy link
Author

thank you!

@dhardy dhardy closed this as completed Jan 4, 2019
@dignifiedquire
Copy link
Author

dignifiedquire commented Jan 4, 2019

Can confirm, the 0.6.3 release fixes all my issues

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

2 participants