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

Yank rand 0.7.1 due to failure to compile with unresolved rand_core::OsRng import #890

Closed
joshsleeper opened this issue Sep 16, 2019 · 4 comments

Comments

@joshsleeper
Copy link

joshsleeper commented Sep 16, 2019

Common issues

Problem: rand 0.7.1 is failing to compile with the following error:

$ cargo check
    Checking rand v0.7.1
error[E0432]: unresolved import `rand_core::OsRng`
   --> /home/jsleeper/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.7.1/src/rngs/mod.rs:119:37
    |
119 | #[cfg(feature="getrandom")] pub use rand_core::OsRng;
    |                                     ^^^^^^^^^^^^^^^^ no `OsRng` in the root

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `rand`.

To learn more, run the command again with --verbose.

Quick solutions:

  • run cargo update
    OR
  • run cargo update --package rand_core to force just rand_core to update

Details: A quick look and test makes me think (if I'm reading Cargo.toml correctly) this might be due to rand 0.7.1 requiring changes from rand_core 0.5.1, but only technically depending on rand_core 0.5?

rand_core dep requirement in Cargo.toml: https://github.com/rust-random/rand/blob/master/Cargo.toml#L57

rand_core 0.5.1 changelog: https://github.com/rust-random/rand/blob/master/rand_core/CHANGELOG.md#051---2019-08-28

@benesch
Copy link

benesch commented Sep 16, 2019

Also just ran into it, and I agree with @joshsleeper's assessment. Dependabot compatibility for the release is only 33%: https://dependabot.com/compatibility-score/?dependency-name=rand&package-manager=cargo&previous-version=0.7.0&new-version=0.7.1.

@dhardy
Copy link
Member

dhardy commented Sep 16, 2019

Aha. Thanks for the report; sounds like we should fix this asap!

@dhardy
Copy link
Member

dhardy commented Sep 16, 2019

I've pushed the version bump into #888. Since this only adds tests, it should be fine adding this into the release.

@dhardy dhardy closed this as completed Sep 17, 2019
@dhardy dhardy changed the title rand 0.7.1 failing to compile with unresolved rand_core::OsRng import Yank rand 0.7.1 due to failure to compile with unresolved rand_core::OsRng import Sep 19, 2019
@dhardy
Copy link
Member

dhardy commented Sep 19, 2019

Note: rand 0.7.1 has been yanked because of this bug which presents a significant trip hazard when updating rand without also updating rand_core.

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

3 participants