-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Could not find __OsLocalKeyInner
in thread
when running cargo install
#102549
Comments
This looks like it might be related to #100201. But given that CI passed that change in general seems to work, and it has landed 6 weeks ago without exploding the world, so the question is why it would fail only for you? If you just try to build this as a crate with no dependencies, does that work? use std::cell::Cell;
thread_local!(static LOCK_HELD: Cell<bool> = Cell::new(false));
fn main() {} If that still shows the error, what does |
This still throws the same error:
I tried running |
@thomcc you're on macOS right? Any chance it's a aarch64-apple-darwin? AFAIK our CI builders are x86 machines, so maybe this has to do with the aarch64 target -- but I am sure we would have heard sooner if thread_local was entirely broken on aarch64-apple-darwin...
Hm, that's what I get for copy-pasting commands from the web... I am looking for whatever the playground does when you ask it to 'expand macros'. |
@SumiGovindaraju ah here we go: |
Yes, it is. Output of
|
(I was asking whether @thomcc also has an aarch64 macOS so we can compare.) Okay so it somehow picks the (inefficient) @thomcc is it expected that an aarch64 apple target would use |
@SumiGovindaraju could I also ask you for the output of running this program, compiled with the same toolchain? #![feature(cfg_target_thread_local)]
fn main() {
dbg!(cfg!(target_thread_local));
dbg!(cfg!(not(all(target_family = "wasm", not(target_feature = "atomics")))));
} |
Output:
|
So we really have I am entirely unfamiliar with macOS details so I hope someone more familiar will pick this up here. |
sync thread_local key conditions exactly with what the macro uses This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`. I don't think this should actually change anything, but seems better to be consistent? I looked into this due to rust-lang#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue. r? `@thomcc`
Hey, just was wondering if there was an update on this. |
|
I'm not super familiar with this, so how/where is |
It should be set with your target definition, which isn't something you can change. What does |
Output of
|
Yep, nearly identical to mine... except that I have I guess I'll look into rustc-target tomorrow to see if there's some weird logic you're falling through, but this really makes no sense. |
Hmm, do you happen have We probably should not do this on aarch64, since all versions of macOS on this platform have thread locals (and once rust-lang/compiler-team#556 happens we perhaps shouldn't do it anywhere...). (Ah, did you get rust through macports? I know they've been known to patch us to try to make us work with older versions of macOS... with dubious consequences. I don't know that there's a way to get a nightly Rust this way, though) |
I got Rust using |
Okay that's your problem. You should unset that environment variable. |
FWIW, rust's oldest supported version of macOS is 10.7, and the oldest version we support on aarch64 targets is 11.0 (since this is the oldest version on these targets). Anything else... may work? But is really dubious. |
Alright, that worked. Thanks for your help! |
sync thread_local key conditions exactly with what the macro uses This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`. I don't think this should actually change anything, but seems better to be consistent? I looked into this due to rust-lang#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue. r? `@thomcc`
sync thread_local key conditions exactly with what the macro uses This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`. I don't think this should actually change anything, but seems better to be consistent? I looked into this due to rust-lang#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue. r? `@thomcc`
sync thread_local key conditions exactly with what the macro uses This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`. I don't think this should actually change anything, but seems better to be consistent? I looked into this due to rust-lang/rust#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue. r? `@thomcc`
sync thread_local key conditions exactly with what the macro uses This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`. I don't think this should actually change anything, but seems better to be consistent? I looked into this due to rust-lang/rust#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue. r? `@thomcc`
sync thread_local key conditions exactly with what the macro uses This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`. I don't think this should actually change anything, but seems better to be consistent? I looked into this due to rust-lang/rust#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue. r? `@thomcc`
sync thread_local key conditions exactly with what the macro uses This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`. I don't think this should actually change anything, but seems better to be consistent? I looked into this due to rust-lang/rust#102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue. r? `@thomcc`
I tried this code:
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
Meta
rustc --version --verbose
:Backtrace
Thanks for looking into this! Any help is appreciated.
The text was updated successfully, but these errors were encountered: