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

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

Closed
lienke opened this issue Aug 24, 2019 · 33 comments
Closed

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

lienke opened this issue Aug 24, 2019 · 33 comments
Assignees
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-linux Operating system: Linux P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lienke
Copy link

lienke commented Aug 24, 2019

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.

@jonas-schievink
Copy link
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?

@lienke
Copy link
Author

lienke commented Aug 24, 2019 via email

@jonas-schievink
Copy link
Contributor

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

@dhardy
Copy link
Contributor

dhardy commented Aug 24, 2019

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?

@jonas-schievink
Copy link
Contributor

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

@RalfJung RalfJung changed the title Attempt to build nushell fails rustc could not initialize thread_rng Aug 25, 2019
@RalfJung RalfJung changed the title rustc could not initialize thread_rng rustc could not initialize thread_rng (on pre-getrandom Linux kernel) Aug 25, 2019
@RalfJung RalfJung added the O-linux Operating system: Linux label Aug 25, 2019
@RalfJung
Copy link
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?

@RalfJung
Copy link
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

@dhardy
Copy link
Contributor

dhardy commented Aug 25, 2019

@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.

@estebank estebank added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 26, 2019
@mati865
Copy link
Contributor

mati865 commented Aug 26, 2019

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.

@nikomatsakis
Copy link
Contributor

Check-in from the compiler triage meeting:

This is fixed by #63806, correct? I'm going to mark it as P-high but also assign to @mati865 -- thanks for staying on top of that!

@nikomatsakis nikomatsakis added P-high High priority and removed I-nominated labels Aug 29, 2019
@nikomatsakis
Copy link
Contributor

@rustbot assign @mati865

@rustbot rustbot self-assigned this Aug 29, 2019
@mati865
Copy link
Contributor

mati865 commented Sep 11, 2019

@lienke #63806 was merged, could you check if latest nightly works for you?

@lienke
Copy link
Author

lienke commented Sep 11, 2019

Hi.
Thanks for all the time and effort. Here are the results. These are the most recent items being compiled:

   Compiling directories v1.0.2
   Compiling subprocess v0.1.18
   Compiling want v0.2.0
   Compiling render-tree v0.1.1
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 `want`.
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-installJ61Ab7`

Caused by:
  build failed

Command used:
cargo install nu

On this system:

$ version =o cargo ; uname -a
OS, ker|rel, machine: Linux, 3.16.0-7-amd64, x86_64
Distribution        : Debian 8.11 (jessie) 
cargo 1.37.0 (9edd08916 2019-08-02)
Linux leap 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64 GNU/Linux

Thanks ... cheers, drl

@lienke lienke closed this as completed Sep 11, 2019
@lienke
Copy link
Author

lienke commented Sep 11, 2019

( Previous attempt at reply failed.)
Hi -- thanks for work and effort. Here are the results of cargo install nu:

...   
Compiling isatty v0.1.9
   Compiling directories v1.0.2
   Compiling subprocess v0.1.18
   Compiling want v0.2.0
   Compiling render-tree v0.1.1
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 `want`.
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-installJ61Ab7`

Caused by:
  build failed

On a system:

$ version =o cargo ; uname -a
OS, ker|rel, machine: Linux, 3.16.0-7-amd64, x86_64
Distribution        : Debian 8.11 (jessie) 
cargo 1.37.0 (9edd08916 2019-08-02)
Linux leap 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64 GNU/Linux
leap (~/=5)../from-crates.io $ 

@lienke lienke reopened this Sep 11, 2019
@lienke
Copy link
Author

lienke commented Sep 11, 2019

( Needed to re-open apparently ... cheers, drl )

@mati865
Copy link
Contributor

mati865 commented Sep 11, 2019

rustc 1.37.0 (eae3437df 2019-08-13) probable fix landed only in nightly but you are using stable release.

@lienke
Copy link
Author

lienke commented Sep 11, 2019

Hi.
I thought about that afterward, so (after some research) I did this:

$ ./rustup toolchain install nightly
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2019-09-11, rust version 1.39.0-nightly (34e82a7b7 2019-09-10)
info: downloading component 'rustc'
 66.1 MiB /  66.1 MiB (100 %)   8.8 MiB/s in  8s ETA:  0s
info: downloading component 'rust-std'
176.0 MiB / 176.0 MiB (100 %)   8.7 MiB/s in 21s ETA:  0s
info: downloading component 'cargo'
info: downloading component 'rust-docs'
 11.7 MiB /  11.7 MiB (100 %)   8.8 MiB/s in  1s ETA:  0s
info: installing component 'rustc'
 66.1 MiB /  66.1 MiB (100 %)  11.2 MiB/s in  5s ETA:  0s
info: installing component 'rust-std'
176.0 MiB / 176.0 MiB (100 %)  23.4 MiB/s in  7s ETA:  0s
info: installing component 'cargo'
info: installing component 'rust-docs'
 11.7 MiB /  11.7 MiB (100 %)   6.4 MiB/s in  1s ETA:  0s

  nightly-x86_64-unknown-linux-gnu installed - rustc 1.39.0-nightly (34e82a7b7 2019-09-10)

info: checking for self-updates

So I checked for the version after install nightly and failed compilation:

$ ./rustc --version
rustc 1.37.0 (eae3437df 2019-08-13)

Where does it put the updated (nightly) compiler? ... cheers, drl

@RalfJung
Copy link
Member

rustc +nightly will call the nightly compiler. rustup override set nightly makes nightly the default for your current directory (and its subdirs).

@lienke
Copy link
Author

lienke commented Sep 11, 2019

Hi.
I used rustup default nightly now and I see:

$ rustc --version
rustc 1.39.0-nightly (34e82a7b7 2019-09-10)

Trying the compile again ... cheers, drl

@lienke
Copy link
Author

lienke commented Sep 11, 2019

Hi.
Still failed:

   Compiling base64 v0.10.1
   Compiling regex-automata v0.1.8
   Compiling deflate v0.7.20
   Compiling rustc-hash v1.0.1
   Compiling tokio-current-thread v0.1.6
   Compiling tokio-timer v0.2.11
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.39.0-nightly (34e82a7b7 2019-09-10) 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 `deflate`.
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-install764Jyz`

Caused by:
  build failed

Thanks ... cheers, drl

@mati865
Copy link
Contributor

mati865 commented Sep 11, 2019

Thanks, it's valuable data.

Guess we gotta get rid of rand < 0.7 from every rustc dependency.

@lienke
Copy link
Author

lienke commented Sep 11, 2019

Hi.
After running ``rustup override set nightly`
It finally compiled. Whether it runs or not, we shall see, but this is a giant step in the right direction


   Compiling nu v0.2.0
    Finished release [optimized] target(s) in 13m 26s
  Installing /home/dennisl/.cargo/bin/nu
  Installing /home/dennisl/.cargo/bin/nu_plugin_add
  Installing /home/dennisl/.cargo/bin/nu_plugin_binaryview
  Installing /home/dennisl/.cargo/bin/nu_plugin_edit
  Installing /home/dennisl/.cargo/bin/nu_plugin_inc
  Installing /home/dennisl/.cargo/bin/nu_plugin_skip
  Installing /home/dennisl/.cargo/bin/nu_plugin_str
  Installing /home/dennisl/.cargo/bin/nu_plugin_sum
  Installing /home/dennisl/.cargo/bin/nu_plugin_sys
  Installing /home/dennisl/.cargo/bin/nu_plugin_textview
  Installing /home/dennisl/.cargo/bin/nu_plugin_tree

This is a pretty big rust code compared to others I have seen (perhaps 6 or so), so good work.

I have no idea how setting the default as I first did differs from the way RalfJung suggested, but his suggestion appeared to be the correct one.

Thanks to all for getting me to this point ... cheers, drl

@newpavlov
Copy link
Contributor

newpavlov commented Sep 11, 2019

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)

@lienke
Copy link
Author

lienke commented Sep 11, 2019

@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

@mati865
Copy link
Contributor

mati865 commented Sep 11, 2019

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.

@mati865
Copy link
Contributor

mati865 commented Sep 11, 2019

@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).

@RalfJung
Copy link
Member

I'll see about the tools this or next week

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

@mati865
Copy link
Contributor

mati865 commented Sep 11, 2019

@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.

@RalfJung
Copy link
Member

RalfJung commented Sep 11, 2019

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.

Centril added a commit to Centril/rust that referenced this issue Sep 11, 2019
Upgrade parking_lot and tempfile rustc dependencies

This should be last piece to unbreak `rustc` in rust-lang#63848
bors added a commit that referenced this issue Sep 13, 2019
Upgrade parking_lot and tempfile rustc dependencies

This should be last piece to unbreak `rustc` in #63848
bors added a commit that referenced this issue Sep 16, 2019
Upgrade parking_lot and tempfile rustc dependencies

This should be last piece to unbreak `rustc` in #63848
@mati865
Copy link
Contributor

mati865 commented Sep 16, 2019

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

@RalfJung
Copy link
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).

@lienke
Copy link
Author

lienke commented Sep 22, 2019

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

@lienke
Copy link
Author

lienke commented Sep 23, 2019

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)]

@lienke lienke closed this as completed Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-linux Operating system: Linux P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

9 participants