Skip to content

Updating to rand 0.6.2 breaks build #675

Closed

Description

@dignifiedquire

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)

Activity

  1. changed the title [-]updating to rand 0.6.2 breaks[/-] [+]Updating to rand 0.6.2 breaks build[/+] on Jan 4, 2019
  2. dhardy commented on Jan 4, 2019

    @dhardy
    Member

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

  3. dignifiedquire commented on Jan 4, 2019

    @dignifiedquire
    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?

  4. dhardy commented on Jan 4, 2019

    @dhardy
    Member

    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

  5. dignifiedquire commented on Jan 4, 2019

    @dignifiedquire
    Author

    thank you!

  6. dignifiedquire commented on Jan 4, 2019

    @dignifiedquire
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions