Skip to content

Could not find __OsLocalKeyInner in thread when running cargo install #102549

Closed
@SumiGovindaraju

Description

@SumiGovindaraju

I tried this code:

cargo install cargo-binutils

The installation of this crate should work, but instead I run into this error (I also see the same error when trying to build other personal repositories):

Console Output
    Updating crates.io index
  Installing cargo-binutils v0.3.6
   Compiling proc-macro2 v1.0.46
   Compiling unicode-ident v1.0.4
   Compiling quote v1.0.21
   Compiling syn v1.0.101
   Compiling serde_derive v1.0.145
   Compiling serde v1.0.145
   Compiling memchr v2.5.0
   Compiling libc v0.2.134
   Compiling cc v1.0.73
   Compiling adler v1.0.2
   Compiling semver v1.0.14
   Compiling failure_derive v0.1.8
   Compiling unicode-xid v0.2.4
   Compiling gimli v0.26.2
   Compiling miniz_oxide v0.5.4
   Compiling rustc-demangle v0.1.21
   Compiling camino v1.1.1
   Compiling object v0.29.0
   Compiling backtrace v0.3.66
   Compiling cfg-if v1.0.0
   Compiling serde_json v1.0.85
   Compiling unicode-width v0.1.10
   Compiling itoa v1.0.3
   Compiling ryu v1.0.11
   Compiling anyhow v1.0.65
   Compiling textwrap v0.11.0
   Compiling atty v0.2.14
   Compiling aho-corasick v0.7.19
   Compiling vec_map v0.8.2
   Compiling strsim v0.8.0
   Compiling bitflags v1.3.2
   Compiling regex-syntax v0.6.27
   Compiling ansi_term v0.12.1
   Compiling clap v2.34.0
   Compiling addr2line v0.17.0
   Compiling synstructure v0.12.6
   Compiling regex v1.6.0
error[E0433]: failed to resolve: could not find `__OsLocalKeyInner` in `thread`
   --> /Users/sumukhgovindaraju/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.66/src/lib.rs:163:5
    |
163 |     thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `__OsLocalKeyInner` in `thread`
    |
    = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

WARN rustc_errors::emitter Invalid span /rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs:338:47: 338:64 (#147), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs" }) }
error[E0412]: cannot find type `__OsLocalKeyInner` in module `$crate::thread`
   --> /Users/sumukhgovindaraju/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.66/src/lib.rs:163:5
    |
163 |     thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `__FastLocalKeyInner`
    |
    = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `__OsLocalKeyInner` in `thread`
  --> /Users/sumukhgovindaraju/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-1.6.0/src/pool.rs:67:1
   |
67 | / thread_local!(
68 | |     /// A thread local used to assign an ID to a thread.
69 | |     static THREAD_ID: usize = {
70 | |         let next = COUNTER.fetch_add(1, Ordering::Relaxed);
...  |
84 | |     };
85 | | );
   | |_^ could not find `__OsLocalKeyInner` in `thread`
   |
   = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

WARN rustc_errors::emitter Invalid span /rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs:338:47: 338:64 (#472), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs" }) }
error[E0412]: cannot find type `__OsLocalKeyInner` in module `$crate::thread`
  --> /Users/sumukhgovindaraju/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-1.6.0/src/pool.rs:67:1
   |
67 | / thread_local!(
68 | |     /// A thread local used to assign an ID to a thread.
69 | |     static THREAD_ID: usize = {
70 | |         let next = COUNTER.fetch_add(1, Ordering::Relaxed);
...  |
84 | |     };
85 | | );
   | |_^ help: a struct with a similar name exists: `__FastLocalKeyInner`
   |
   = note: this error originates in the macro `$crate::__thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0412, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `backtrace` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `regex` due to 2 previous errors
error: failed to compile `cargo-binutils v0.3.6`, intermediate artifacts can be found at `/var/folders/jg/pgt0p9hj0cv0pk6fq9g4wjb40000gn/T/cargo-installLNnPUU`

Meta

rustc --version --verbose:

rustc 1.66.0-nightly (8ce3204af 2022-09-30)
binary: rustc
commit-hash: 8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6
commit-date: 2022-09-30
host: aarch64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2
Backtrace

    Updating crates.io index
  Installing cargo-binutils v0.3.6
   Compiling proc-macro2 v1.0.46
   Compiling unicode-ident v1.0.4
   Compiling quote v1.0.21
   Compiling syn v1.0.101
   Compiling serde_derive v1.0.145
   Compiling serde v1.0.145
   Compiling memchr v2.5.0
   Compiling libc v0.2.134
   Compiling cc v1.0.73
   Compiling adler v1.0.2
   Compiling unicode-xid v0.2.4
   Compiling semver v1.0.14
   Compiling gimli v0.26.2
   Compiling failure_derive v0.1.8
   Compiling miniz_oxide v0.5.4
   Compiling cfg-if v1.0.0
   Compiling camino v1.1.1
   Compiling serde_json v1.0.85
   Compiling backtrace v0.3.66
   Compiling object v0.29.0
   Compiling rustc-demangle v0.1.21
   Compiling itoa v1.0.3
   Compiling ryu v1.0.11
   Compiling unicode-width v0.1.10
   Compiling anyhow v1.0.65
   Compiling textwrap v0.11.0
   Compiling atty v0.2.14
   Compiling aho-corasick v0.7.19
   Compiling vec_map v0.8.2
   Compiling regex-syntax v0.6.27
   Compiling strsim v0.8.0
   Compiling ansi_term v0.12.1
   Compiling addr2line v0.17.0
   Compiling bitflags v1.3.2
   Compiling clap v2.34.0
   Compiling synstructure v0.12.6
   Compiling regex v1.6.0
error[E0433]: failed to resolve: could not find `__OsLocalKeyInner` in `thread`
   |
  ::: /Users/sumukhgovindaraju/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-1.6.0/src/pool.rs:67:1
   |
67 | / thread_local!(
68 | |     /// A thread local used to assign an ID to a thread.
69 | |     static THREAD_ID: usize = {
70 | |         let next = COUNTER.fetch_add(1, Ordering::Relaxed);
...  |
84 | |     };
85 | | );
   | |_- in this macro invocation (#1)

WARN rustc_errors::emitter Invalid span /rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs:338:47: 338:64 (#472), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs" }) }
error[E0412]: cannot find type `__OsLocalKeyInner` in module `$crate::thread`
   |
  ::: /Users/sumukhgovindaraju/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-1.6.0/src/pool.rs:67:1
   |
67 | / thread_local!(
68 | |     /// A thread local used to assign an ID to a thread.
69 | |     static THREAD_ID: usize = {
70 | |         let next = COUNTER.fetch_add(1, Ordering::Relaxed);
...  |
84 | |     };
85 | | );
   | |_- in this macro invocation (#1)

Some errors have detailed explanations: E0412, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `regex` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0433]: failed to resolve: could not find `__OsLocalKeyInner` in `thread`
    |
   ::: /Users/sumukhgovindaraju/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.66/src/lib.rs:163:5
    |
163 |     thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
    |     -------------------------------------------------------------- in this macro invocation (#1)

WARN rustc_errors::emitter Invalid span /rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs:338:47: 338:64 (#147), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "/rustc/8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6/library/std/src/thread/local.rs" }) }
error[E0412]: cannot find type `__OsLocalKeyInner` in module `$crate::thread`
    |
   ::: /Users/sumukhgovindaraju/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.66/src/lib.rs:163:5
    |
163 |     thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
    |     -------------------------------------------------------------- in this macro invocation (#1)

error: could not compile `backtrace` due to 2 previous errors
error: failed to compile `cargo-binutils v0.3.6`, intermediate artifacts can be found at `/var/folders/jg/pgt0p9hj0cv0pk6fq9g4wjb40000gn/T/cargo-installqHa6cL`

Thanks for looking into this! Any help is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-thread-localsArea: Thread local storage (TLS)C-bugCategory: This is a bug.O-macosOperating system: macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions