Skip to content

rustc could not initialize thread_rng (on pre-getrandom Linux kernel) #63848

Closed

Description

@lienke
nushell: https://book.nushell.sh/en/installation / no on-point issues seen here -- searched for "nushell"

Tried to build nushell from source and it required "nightly" rust. Didn't know how to install that, so I used "cargo install nu"

I expected to see this happen:
Build complete -- the cargo install has worked with other tools.

Instead, this happened:

thread 'rustc' panicked at 'could not initialize thread_rng: All entropy sources failed (permanently unavailable); cause: OS RNG not yet seeded (not ready yet); cause: Resource temporarily unavailable (os error 11)', /cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.1/src/rngs/thread.rs:82:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.37.0 (eae3437df 2019-08-13) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `openssl-sys`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `nu v0.2.0`, intermediate artifacts can be found at `/tmp/cargo-installbNbt6y`

Meta

rustc --version --verbose:

rustc 1.37.0 (eae3437df 2019-08-13)
binary: rustc
commit-hash: eae3437dfe991621e8afdc82734f4a172d7ddf9b
commit-date: 2019-08-13
host: x86_64-unknown-linux-gnu
release: 1.37.0
LLVM version: 8.0

This issue has been assigned to @mati865 via this comment.

Activity

  1. jonas-schievink commented on Aug 24, 2019

    @jonas-schievink
    Contributor

    This looks like an issue in the getrandom crate (cc @dhardy @newpavlov).

    What distro and hardware are you building on? Can you post the output of uname -a?

  2. lienke commented on Aug 24, 2019

    @lienke
    Author
  3. jonas-schievink commented on Aug 24, 2019

    @jonas-schievink
    Contributor

    That kernel version is missing the getrandom() syscall, so perhaps there's something wrong with the fallback paths in the getrandom crate?

  4. dhardy commented on Aug 24, 2019

    @dhardy
    Contributor

    The error report uses Rand v0.6.1 which does not even use the getrandom crate. It would be nice to see if updating nu to rand 0.7 fixes the problem @jonathandturner. We are aware of a potential issue when many new thread-rngs are initialised in a short space of time: rust-random/rand#804 (fixed in recent versions of getrandom).

    I don't understand why this issue was reported here, instead of against nu or rand?

  5. jonas-schievink commented on Aug 24, 2019

    @jonas-schievink
    Contributor

    @dhardy the compiler is panicking due to its use of rand, not nushell

  6. changed the title [-]Attempt to build nushell fails[/-] [+]rustc could not initialize thread_rng[/+] on Aug 25, 2019
  7. changed the title [-]rustc could not initialize thread_rng[/-] [+]rustc could not initialize thread_rng (on pre-getrandom Linux kernel)[/+] on Aug 25, 2019
  8. RalfJung commented on Aug 25, 2019

    @RalfJung
    Member

    Not sure how much it would take to update rustc to rand 0.7.0, but updating to 0.6.5 would be easy. @dhardy do you think that could help?

  9. RalfJung commented on Aug 25, 2019

    @RalfJung
    Member

    Actually, doing cargo update -p rand:0.6.1 breaks the build. Looks like rand accidentally released a breaking change as a patch release?

    Build error
    error[E0277]: the trait bound `rand_pcg::Mcg128Xsl64: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/small.rs:96:6
       |
    96 | impl SeedableRng for SmallRng {
       |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_pcg::Mcg128Xsl64`
    
    error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/std.rs:55:6
       |
    55 | impl SeedableRng for StdRng {
       |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
    
    error[E0277]: the trait bound `rand_isaac::IsaacRng: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:50:6
       |
    50 | impl SeedableRng for IsaacRng {
       |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::IsaacRng`
    
    error[E0277]: the trait bound `rand_isaac::Isaac64Rng: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:96:6
       |
    96 | impl SeedableRng for Isaac64Rng {
       |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::Isaac64Rng`
    
    error[E0277]: the trait bound `rand_chacha::ChaChaRng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:141:6
        |
    141 | impl SeedableRng for ChaChaRng {
        |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_chacha::ChaChaRng`
    
    error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:198:6
        |
    198 | impl SeedableRng for Hc128Rng {
        |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
    
    error[E0277]: the trait bound `rand_xorshift::XorShiftRng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:239:6
        |
    239 | impl SeedableRng for XorShiftRng {
        |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_xorshift::XorShiftRng`
    
    error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:279:6
        |
    279 | impl SeedableRng for StdRng {
        |      ^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
    
    error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:73:5
       |
    73 |     rng: *mut ReseedingRng<Hc128Core, EntropyRng>,
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
       |
    note: required by `rngs::adapter::reseeding::ReseedingRng`
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
       |
    88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
    89 | | where R: BlockRngCore + SeedableRng,
    90 | |       Rsdr: RngCore;
       | |____________________^
    
    error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:73:5
       |
    73 |     rng: *mut ReseedingRng<Hc128Core, EntropyRng>,
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
       |
    note: required by `rngs::adapter::reseeding::ReseedingRng`
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
       |
    88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
    89 | | where R: BlockRngCore + SeedableRng,
    90 | |       Rsdr: RngCore;
       | |____________________^
    
    error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
       | 
      ::: <::std::thread::local::thread_local macros>:1:1
       |
    1  |   / () => { } ;
    2  |   | ($ (# [$ attr : meta]) * $ vis : vis static $ name : ident : $ t : ty = $ init
    3  |   |  : expr ; $ ($ rest : tt) *) =>
    4  |   | ($ crate :: __thread_local_inner !
    ...    |
    9  |   | ($ crate :: __thread_local_inner !
       |  _|__-
    10 | | |  ($ (# [$ attr]) * $ vis $ name , $ t , $ init) ;) ;
       | | |_________________________________________________-__- in this expansion of `thread_local!`
       | |___________________________________________________|
       |                                                     in this macro invocation
      --> <::std::thread::local::__thread_local_inner macros>:36:43
       |
    1  |  /  (@ key $ (# [$ attr : meta]) * $ vis : vis $ name : ident , $ t : ty , $ init
    2  |  |   : expr) =>
    3  |  |  {
    4  |  |      {
    ...   |
    36 |  |      $ (# [$ attr]) * $ vis const $ name : $ crate :: thread :: LocalKey < $ t
       |  |____________________________________________^
    37 | ||      > = $ crate :: __thread_local_inner !
       | ||______^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
    38 |  |      (@ key $ (# [$ attr]) * $ vis $ name , $ t , $ init) ;
    39 |  |  }
       |  |__- in this expansion of `$crate::__thread_local_inner!`
       | 
      ::: /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
       |
    76 | /   thread_local!(
    77 | |       static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
    78 | |           let mut entropy_source = EntropyRng::new();
    79 | |           let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
    ...  |
    85 | |       }
    86 | |   );
       | |____- in this macro invocation
       |
    note: required by `rngs::adapter::reseeding::ReseedingRng`
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
       |
    88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
    89 | | where R: BlockRngCore + SeedableRng,
    90 | |       Rsdr: RngCore;
       | |____________________^
    
    error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
       | 
      ::: <::std::thread::local::thread_local macros>:1:1
       |
    1  |   / () => { } ;
    2  |   | ($ (# [$ attr : meta]) * $ vis : vis static $ name : ident : $ t : ty = $ init
    3  |   |  : expr ; $ ($ rest : tt) *) =>
    4  |   | ($ crate :: __thread_local_inner !
    ...    |
    9  |   | ($ crate :: __thread_local_inner !
       |  _|__-
    10 | | |  ($ (# [$ attr]) * $ vis $ name , $ t , $ init) ;) ;
       | | |_________________________________________________-__- in this expansion of `thread_local!`
       | |___________________________________________________|
       |                                                     in this macro invocation
      --> <::std::thread::local::__thread_local_inner macros>:36:43
       |
    1  |  /  (@ key $ (# [$ attr : meta]) * $ vis : vis $ name : ident , $ t : ty , $ init
    2  |  |   : expr) =>
    3  |  |  {
    4  |  |      {
    ...   |
    36 |  |      $ (# [$ attr]) * $ vis const $ name : $ crate :: thread :: LocalKey < $ t
       |  |____________________________________________^
    37 | ||      > = $ crate :: __thread_local_inner !
       | ||______^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
    38 |  |      (@ key $ (# [$ attr]) * $ vis $ name , $ t , $ init) ;
    39 |  |  }
       |  |__- in this expansion of `$crate::__thread_local_inner!`
       | 
      ::: /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
       |
    76 | /   thread_local!(
    77 | |       static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
    78 | |           let mut entropy_source = EntropyRng::new();
    79 | |           let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
    ...  |
    85 | |       }
    86 | |   );
       | |____- in this macro invocation
       |
    note: required by `rngs::adapter::reseeding::ReseedingRng`
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
       |
    88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
    89 | | where R: BlockRngCore + SeedableRng,
    90 | |       Rsdr: RngCore;
       | |____________________^
    
    error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
      --> <::std::thread::local::__thread_local_inner macros>:5:20
       |
    1  |  /   (@ key $ (# [$ attr : meta]) * $ vis : vis $ name : ident , $ t : ty , $ init
    2  |  |    : expr) =>
    3  |  |   {
    4  |  |       {
    5  |  |           # [inline] fn __init () -> $ t { $ init } unsafe fn __getit () -> $
       |  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
    ...   |
    37 |  |       > = $ crate :: __thread_local_inner !
       |  |___________-
    38 | ||       (@ key $ (# [$ attr]) * $ vis $ name , $ t , $ init) ;
       | ||__________________________________________________________- in this macro invocation (#3)
    39 |  |   }
       |  |   -
       |  |   |
       |  |___in this expansion of `$crate::__thread_local_inner!` (#2)
       |      in this expansion of `$crate::__thread_local_inner!` (#3)
       | 
      ::: <::std::thread::local::thread_local macros>:1:1
       |
    1  |    / () => { } ;
    2  |    | ($ (# [$ attr : meta]) * $ vis : vis static $ name : ident : $ t : ty = $ init
    3  |    |  : expr ; $ ($ rest : tt) *) =>
    4  |    | ($ crate :: __thread_local_inner !
    ...     |
    9  |    | ($ crate :: __thread_local_inner !
       |  __|__-
    10 | |  |  ($ (# [$ attr]) * $ vis $ name , $ t , $ init) ;) ;
       | |  |_________________________________________________-__- in this expansion of `thread_local!` (#1)
       | |____________________________________________________|
       |                                                      in this macro invocation (#2)
       | 
      ::: /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
       |
    76 | /    thread_local!(
    77 | |        static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
    78 | |            let mut entropy_source = EntropyRng::new();
    79 | |            let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
    ...  |
    85 | |        }
    86 | |    );
       | |_____- in this macro invocation (#1)
       |
    note: required by `rngs::adapter::reseeding::ReseedingRng`
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
       |
    88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
    89 | | where R: BlockRngCore + SeedableRng,
    90 | |       Rsdr: RngCore;
       | |____________________^
    
    error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
      --> <::std::thread::local::__thread_local_inner macros>:5:20
       |
    1  |  /   (@ key $ (# [$ attr : meta]) * $ vis : vis $ name : ident , $ t : ty , $ init
    2  |  |    : expr) =>
    3  |  |   {
    4  |  |       {
    5  |  |           # [inline] fn __init () -> $ t { $ init } unsafe fn __getit () -> $
       |  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
    ...   |
    37 |  |       > = $ crate :: __thread_local_inner !
       |  |___________-
    38 | ||       (@ key $ (# [$ attr]) * $ vis $ name , $ t , $ init) ;
       | ||__________________________________________________________- in this macro invocation (#3)
    39 |  |   }
       |  |   -
       |  |   |
       |  |___in this expansion of `$crate::__thread_local_inner!` (#2)
       |      in this expansion of `$crate::__thread_local_inner!` (#3)
       | 
      ::: <::std::thread::local::thread_local macros>:1:1
       |
    1  |    / () => { } ;
    2  |    | ($ (# [$ attr : meta]) * $ vis : vis static $ name : ident : $ t : ty = $ init
    3  |    |  : expr ; $ ($ rest : tt) *) =>
    4  |    | ($ crate :: __thread_local_inner !
    ...     |
    9  |    | ($ crate :: __thread_local_inner !
       |  __|__-
    10 | |  |  ($ (# [$ attr]) * $ vis $ name , $ t , $ init) ;) ;
       | |  |_________________________________________________-__- in this expansion of `thread_local!` (#1)
       | |____________________________________________________|
       |                                                      in this macro invocation (#2)
       | 
      ::: /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
       |
    76 | /    thread_local!(
    77 | |        static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
    78 | |            let mut entropy_source = EntropyRng::new();
    79 | |            let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
    ...  |
    85 | |        }
    86 | |    );
       | |_____- in this macro invocation (#1)
       |
    note: required by `rngs::adapter::reseeding::ReseedingRng`
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
       |
    88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
    89 | | where R: BlockRngCore + SeedableRng,
    90 | |       Rsdr: RngCore;
       | |____________________^
    
    error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
       | 
      ::: <::std::thread::local::thread_local macros>:1:1
       |
    1  |     / () => { } ;
    2  |     | ($ (# [$ attr : meta]) * $ vis : vis static $ name : ident : $ t : ty = $ init
    3  |     |  : expr ; $ ($ rest : tt) *) =>
    4  |     | ($ crate :: __thread_local_inner !
    ...      |
    9  |     | ($ crate :: __thread_local_inner !
       |  ___|__-
    10 | |   |  ($ (# [$ attr]) * $ vis $ name , $ t , $ init) ;) ;
       | |   |_________________________________________________-__- in this expansion of `thread_local!` (#1)
       | |_____________________________________________________|
       |                                                       in this macro invocation (#2)
      --> <::std::thread::local::__thread_local_inner macros>:5:51
       |
    1  |   /   (@ key $ (# [$ attr : meta]) * $ vis : vis $ name : ident , $ t : ty , $ init
    2  |   |    : expr) =>
    3  |   |   {
    4  |   |       {
    5  |   |           # [inline] fn __init () -> $ t { $ init } unsafe fn __getit () -> $
       |   |_____________________________________________________^
    6  |  ||           crate :: option :: Option < & 'static $ t >
    7  |  ||           {
    8  |  ||               #
    ...   ||
    29 |  ||               get (__init)
    30 |  ||           } unsafe { $ crate :: thread :: LocalKey :: new (__getit) }
       |  ||___________^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
    ...    |
    37 |   |       > = $ crate :: __thread_local_inner !
       |  _|___________-
    38 | | |       (@ key $ (# [$ attr]) * $ vis $ name , $ t , $ init) ;
       | |_|__________________________________________________________- in this macro invocation (#3)
    39 |   |   }
       |   |   -
       |   |   |
       |   |___in this expansion of `$crate::__thread_local_inner!` (#2)
       |       in this expansion of `$crate::__thread_local_inner!` (#3)
       | 
      ::: /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
       |
    76 | /     thread_local!(
    77 | |         static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
    78 | |             let mut entropy_source = EntropyRng::new();
    79 | |             let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
    ...  |
    85 | |         }
    86 | |     );
       | |______- in this macro invocation (#1)
       |
    note: required by `rngs::adapter::reseeding::ReseedingRng`
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
       |
    88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
    89 | | where R: BlockRngCore + SeedableRng,
    90 | |       Rsdr: RngCore;
       | |____________________^
    
    error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
       | 
      ::: <::std::thread::local::thread_local macros>:1:1
       |
    1  |     / () => { } ;
    2  |     | ($ (# [$ attr : meta]) * $ vis : vis static $ name : ident : $ t : ty = $ init
    3  |     |  : expr ; $ ($ rest : tt) *) =>
    4  |     | ($ crate :: __thread_local_inner !
    ...      |
    9  |     | ($ crate :: __thread_local_inner !
       |  ___|__-
    10 | |   |  ($ (# [$ attr]) * $ vis $ name , $ t , $ init) ;) ;
       | |   |_________________________________________________-__- in this expansion of `thread_local!` (#1)
       | |_____________________________________________________|
       |                                                       in this macro invocation (#2)
      --> <::std::thread::local::__thread_local_inner macros>:5:51
       |
    1  |   /   (@ key $ (# [$ attr : meta]) * $ vis : vis $ name : ident , $ t : ty , $ init
    2  |   |    : expr) =>
    3  |   |   {
    4  |   |       {
    5  |   |           # [inline] fn __init () -> $ t { $ init } unsafe fn __getit () -> $
       |   |_____________________________________________________^
    6  |  ||           crate :: option :: Option < & 'static $ t >
    7  |  ||           {
    8  |  ||               #
    ...   ||
    29 |  ||               get (__init)
    30 |  ||           } unsafe { $ crate :: thread :: LocalKey :: new (__getit) }
       |  ||___________^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
    ...    |
    37 |   |       > = $ crate :: __thread_local_inner !
       |  _|___________-
    38 | | |       (@ key $ (# [$ attr]) * $ vis $ name , $ t , $ init) ;
       | |_|__________________________________________________________- in this macro invocation (#3)
    39 |   |   }
       |   |   -
       |   |   |
       |   |___in this expansion of `$crate::__thread_local_inner!` (#2)
       |       in this expansion of `$crate::__thread_local_inner!` (#3)
       | 
      ::: /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
       |
    76 | /     thread_local!(
    77 | |         static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
    78 | |             let mut entropy_source = EntropyRng::new();
    79 | |             let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
    ...  |
    85 | |         }
    86 | |     );
       | |______- in this macro invocation (#1)
       |
    note: required by `rngs::adapter::reseeding::ReseedingRng`
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
       |
    88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
    89 | | where R: BlockRngCore + SeedableRng,
    90 | |       Rsdr: RngCore;
       | |____________________^
    
    error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::block::BlockRngCore` is not satisfied
       | 
      ::: <::std::thread::local::thread_local macros>:1:1
       |
    1  |    / () => { } ;
    2  |    | ($ (# [$ attr : meta]) * $ vis : vis static $ name : ident : $ t : ty = $ init
    3  |    |  : expr ; $ ($ rest : tt) *) =>
    4  |    | ($ crate :: __thread_local_inner !
    ...     |
    9  |    | ($ crate :: __thread_local_inner !
       |  __|__-
    10 | |  |  ($ (# [$ attr]) * $ vis $ name , $ t , $ init) ;) ;
       | |  |_________________________________________________-__- in this expansion of `thread_local!` (#1)
       | |____________________________________________________|
       |                                                      in this macro invocation (#2)
      --> <::std::thread::local::__thread_local_inner macros>:20:36
       |
    1  |  /   (@ key $ (# [$ attr : meta]) * $ vis : vis $ name : ident , $ t : ty , $ init
    2  |  |    : expr) =>
    3  |  |   {
    4  |  |       {
    ...   |
    20 |  |                  ,))] static __KEY : $ crate :: thread :: __FastLocalKeyInner <
       |  |______________________________________^
    21 | ||               $ t > = $ crate :: thread :: __FastLocalKeyInner :: new () ; #
       | ||___________________^ the trait `rand_core::block::BlockRngCore` is not implemented for `rand_hc::Hc128Core`
    ...   |
    37 |  |       > = $ crate :: __thread_local_inner !
       |  |___________-
    38 | ||       (@ key $ (# [$ attr]) * $ vis $ name , $ t , $ init) ;
       | ||__________________________________________________________- in this macro invocation (#3)
    39 |  |   }
       |  |   -
       |  |   |
       |  |___in this expansion of `$crate::__thread_local_inner!` (#2)
       |      in this expansion of `$crate::__thread_local_inner!` (#3)
       | 
      ::: /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
       |
    76 | /    thread_local!(
    77 | |        static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
    78 | |            let mut entropy_source = EntropyRng::new();
    79 | |            let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
    ...  |
    85 | |        }
    86 | |    );
       | |_____- in this macro invocation (#1)
       |
    note: required by `rngs::adapter::reseeding::ReseedingRng`
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
       |
    88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
    89 | | where R: BlockRngCore + SeedableRng,
    90 | |       Rsdr: RngCore;
       | |____________________^
    
    error[E0277]: the trait bound `rand_hc::Hc128Core: rand_core::SeedableRng` is not satisfied
       | 
      ::: <::std::thread::local::thread_local macros>:1:1
       |
    1  |    / () => { } ;
    2  |    | ($ (# [$ attr : meta]) * $ vis : vis static $ name : ident : $ t : ty = $ init
    3  |    |  : expr ; $ ($ rest : tt) *) =>
    4  |    | ($ crate :: __thread_local_inner !
    ...     |
    9  |    | ($ crate :: __thread_local_inner !
       |  __|__-
    10 | |  |  ($ (# [$ attr]) * $ vis $ name , $ t , $ init) ;) ;
       | |  |_________________________________________________-__- in this expansion of `thread_local!` (#1)
       | |____________________________________________________|
       |                                                      in this macro invocation (#2)
      --> <::std::thread::local::__thread_local_inner macros>:20:36
       |
    1  |  /   (@ key $ (# [$ attr : meta]) * $ vis : vis $ name : ident , $ t : ty , $ init
    2  |  |    : expr) =>
    3  |  |   {
    4  |  |       {
    ...   |
    20 |  |                  ,))] static __KEY : $ crate :: thread :: __FastLocalKeyInner <
       |  |______________________________________^
    21 | ||               $ t > = $ crate :: thread :: __FastLocalKeyInner :: new () ; #
       | ||___________________^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Core`
    ...   |
    37 |  |       > = $ crate :: __thread_local_inner !
       |  |___________-
    38 | ||       (@ key $ (# [$ attr]) * $ vis $ name , $ t , $ init) ;
       | ||__________________________________________________________- in this macro invocation (#3)
    39 |  |   }
       |  |   -
       |  |   |
       |  |___in this expansion of `$crate::__thread_local_inner!` (#2)
       |      in this expansion of `$crate::__thread_local_inner!` (#3)
       | 
      ::: /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/thread.rs:76:1
       |
    76 | /    thread_local!(
    77 | |        static THREAD_RNG_KEY: UnsafeCell<ReseedingRng<Hc128Core, EntropyRng>> = {
    78 | |            let mut entropy_source = EntropyRng::new();
    79 | |            let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err|
    ...  |
    85 | |        }
    86 | |    );
       | |_____- in this macro invocation (#1)
       |
    note: required by `rngs::adapter::reseeding::ReseedingRng`
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/adapter/reseeding.rs:88:1
       |
    88 | / pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
    89 | | where R: BlockRngCore + SeedableRng,
    90 | |       Rsdr: RngCore;
       | |____________________^
    
    error[E0277]: the trait bound `rand_pcg::Mcg128Xsl64: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/small.rs:97:5
       |
    97 |     type Seed = <Rng as SeedableRng>::Seed;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_pcg::Mcg128Xsl64`
    
    error[E0277]: the trait bound `rand_pcg::Mcg128Xsl64: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/small.rs:99:5
        |
    99  | /     fn from_seed(seed: Self::Seed) -> Self {
    100 | |         SmallRng(Rng::from_seed(seed))
    101 | |     }
        | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_pcg::Mcg128Xsl64`
    
    error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/std.rs:56:5
       |
    56 |     type Seed = <Hc128Rng as SeedableRng>::Seed;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
    
    error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/rngs/std.rs:58:5
       |
    58 | /     fn from_seed(seed: Self::Seed) -> Self {
    59 | |         StdRng(Hc128Rng::from_seed(seed))
    60 | |     }
       | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
    
    error[E0277]: the trait bound `rand_isaac::IsaacRng: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:51:5
       |
    51 |     type Seed = <rand_isaac::IsaacRng as SeedableRng>::Seed;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::IsaacRng`
    
    error[E0277]: the trait bound `rand_isaac::IsaacRng: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:53:5
       |
    53 | /     fn from_seed(seed: Self::Seed) -> Self {
    54 | |         IsaacRng(rand_isaac::IsaacRng::from_seed(seed))
    55 | |     }
       | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::IsaacRng`
    
    error[E0277]: the trait bound `rand_isaac::Isaac64Rng: rand_core::SeedableRng` is not satisfied
      --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:97:5
       |
    97 |     type Seed = <rand_isaac::Isaac64Rng as SeedableRng>::Seed;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::Isaac64Rng`
    
    error[E0277]: the trait bound `rand_isaac::Isaac64Rng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:99:5
        |
    99  | /     fn from_seed(seed: Self::Seed) -> Self {
    100 | |         Isaac64Rng(rand_isaac::Isaac64Rng::from_seed(seed))
    101 | |     }
        | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_isaac::Isaac64Rng`
    
    error[E0277]: the trait bound `rand_chacha::ChaChaRng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:142:5
        |
    142 |     type Seed = <rand_chacha::ChaChaRng as SeedableRng>::Seed;
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_chacha::ChaChaRng`
    
    error[E0277]: the trait bound `rand_chacha::ChaChaRng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:144:5
        |
    144 | /     fn from_seed(seed: Self::Seed) -> Self {
    145 | |         ChaChaRng(rand_chacha::ChaChaRng::from_seed(seed))
    146 | |     }
        | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_chacha::ChaChaRng`
    
    error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:199:5
        |
    199 |     type Seed = <rand_hc::Hc128Rng as SeedableRng>::Seed;
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
    
    error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:201:5
        |
    201 | /     fn from_seed(seed: Self::Seed) -> Self {
    202 | |         Hc128Rng(rand_hc::Hc128Rng::from_seed(seed))
    203 | |     }
        | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
    
    error[E0277]: the trait bound `rand_xorshift::XorShiftRng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:240:5
        |
    240 |     type Seed = <::rand_xorshift::XorShiftRng as SeedableRng>::Seed;
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_xorshift::XorShiftRng`
    
    error[E0277]: the trait bound `rand_xorshift::XorShiftRng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:242:5
        |
    242 | /     fn from_seed(seed: Self::Seed) -> Self {
    243 | |         XorShiftRng(::rand_xorshift::XorShiftRng::from_seed(seed))
    244 | |     }
        | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_xorshift::XorShiftRng`
    
    error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:280:5
        |
    280 |     type Seed = <rngs::StdRng as SeedableRng>::Seed;
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
    
    error[E0277]: the trait bound `rand_hc::Hc128Rng: rand_core::SeedableRng` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.6.5/src/deprecated.rs:282:5
        |
    282 | /     fn from_seed(seed: Self::Seed) -> Self {
    283 | |         StdRng(rngs::StdRng::from_seed(seed))
    284 | |     }
        | |_____^ the trait `rand_core::SeedableRng` is not implemented for `rand_hc::Hc128Rng`
    
    error: aborting due to 34 previous errors
    
  10. dhardy commented on Aug 25, 2019

    @dhardy
    Contributor

    @RalfJung that's a known issue; you must update rand_core to at least 0.3.1 at the same time. Unfortunately fixing it now would cause breakage for no_std users IIRC.

  11. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Aug 26, 2019
  12. mati865 commented on Aug 26, 2019

    @mati865
    Member

    The issue with upgrading to rand 0.6.5 is described in rust-random/rand#852
    rand_os is no_std crate using libc with default features. Why does it matter?
    C library is linked by std or libc without default features leaving rand_os with undefined references when building Rust (and probably some no_std crates), see #61393.
    getrandom had the same issue so I updated it in #63806 (I'll update it again tomorrow morning CEST) and this time it worked in local build.

  13. 18 remaining items

  14. newpavlov commented on Sep 11, 2019

    @newpavlov
    Contributor

    Can you add a backtrace? rand 0.6.1 is still a dependency for the following crates:

    • miri
    • parking_lot_core (v0.4.0 is used, while the latest version is v0.6)
    • phf_generator (it was updated recently, but new version have not landed on crates.io yet)
    • rls, rls-rustc
    • rustc-workspace-hack
    • tempfile (we need to just update to v3.1.0 here)
    • tokio-threadpool
    • uuid (the update has not yet landed on crates.io)
  15. lienke commented on Sep 11, 2019

    @lienke
    Author

    @newpavlov:
    it compiled. Do you still need a backtrace? I might not be able to replicate the problem, but it may be related to how the default was set ... cheers, drl

  16. mati865 commented on Sep 11, 2019

    @mati865
    Member

    Overrides are explained in https://github.com/rust-lang/rustup.rs#directory-overrides

    I identified parking_lot 0.7.1 and tempfile as rustc dependencies pulling in old rand.

  17. mati865 commented on Sep 11, 2019

    @mati865
    Member

    @newpavlov it's true the tools might not work because of the old rand but much more important is to have rustc working.
    #64381 should take care of it, I'll see about the tools this or next week (it's hard because upgrade has to be coordinated).

  18. RalfJung commented on Sep 11, 2019

    @RalfJung
    Member

    I'll see about the tools this or next week

    For Miri I already opened rust-lang/miri#947.

  19. mati865 commented on Sep 11, 2019

    @mati865
    Member

    @RalfJung the thing is currently all the tools and

    rand = { version = "0.6.1", features = ["i128_support"] }
    probably need to be upgraded in single PR. I think duplicated dependencies check will fail otherwise and you'll have to revert rand upgrade but if you can make it though it'd be great.

    I'll start with removing unnecessary dependencies from rustc-workspace-hack.

  20. RalfJung commented on Sep 11, 2019

    @RalfJung
    Member

    I think duplicated dependencies check will fail otherwise

    I don't think so. That check is for the same version of the same crate being compiled multiple times due to different feature flags.

    We've had multiple versions of memoffset in our Cargo.lock for quite some time already.

  21. added a commit that references this issue on Sep 11, 2019
  22. added 2 commits that reference this issue on Sep 13, 2019
  23. mati865 commented on Sep 16, 2019

    @mati865
    Member

    Status update:
    I believe #64381 should have fixed this issue for rustc executable.
    #64384 removed removed rand dependency from rustc-workspace-hack which should allow tools to upgrade their rand dependency.

    @lienke could you try next nightly (it will be released around 2019-09-17 01:00 UTC)?

    edit: fixed date

  24. RalfJung commented on Sep 16, 2019

    @RalfJung
    Member

    will be released on 2019-09-17 00:00 UTC

    To be fully precise, it'll be released around 1h later than that (the release process starts shortly after midnight UTC but it has to shuffle quite a lot of data around so it takes a bit).

  25. lienke commented on Sep 22, 2019

    @lienke
    Author

    Compiled with:
    cargo build --all-features && cargo run --all-features
    and compile failed with several messages about ld not finding several items.

    Recompiled with:
    cargo build
    and finished successfully.
    Versions used:

    rustc 1.39.0-nightly (97e58c0d3 2019-09-20)
    nushell 0.1.3
    

    Thanks to all for dealing with this ... cheers, drl

  26. lienke commented on Sep 23, 2019

    @lienke
    Author

    Installed missing libraries, allowing build to complete, but with warnings. Assuming nu folks will deal with that. Thanks ... cheers, drl

    $ cargo build --all-features && cargo run --all-features
       Compiling nu v0.2.0 (/home/...)
    warning: the feature `async_await` has been stable since 1.39.0 and no longer requires an attribute to enable
     --> src/plugins/sys.rs:1:12
      |
    1 | #![feature(async_await)]
      |            ^^^^^^^^^^^
      |
      = note: `#[warn(stable_features)]` on by default
    
    warning: the feature `async_await` has been stable since 1.39.0 and no longer requires an attribute to enable
     --> src/main.rs:3:12
      |
    3 | #![feature(async_await)]
      |            ^^^^^^^^^^^
      |
      = note: `#[warn(stable_features)]` on by default
    
    warning: the feature `bind_by_move_pattern_guards` has been stable since 1.39.0 and no longer requires an attribute to enable
     --> src/main.rs:5:12
      |
    5 | #![feature(bind_by_move_pattern_guards)]
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-linuxOperating system: LinuxP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions