You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
document args for -Zbuild-std when folks aren't building everything #14889
I expected to see this happen: builds successfully
Instead, this happened:
Compiling std v0.0.0 (.../.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std)
error[E0432]: unresolved import `crate::sys::thread_local::key::StaticKey`
--> .../.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/thread_local/os.rs:5:5
|
5 | use crate::sys::thread_local::key::StaticKey as OsKey;| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `StaticKey`in`sys::thread_local::key`
For more information about this error, try `rustc --explain E0432`.
error: could not compile `std` (lib) due to 1 previous error
changed the title [-]unresolved import `crate::sys::thread_local::key::StaticKey`[/-][+]document args for `-Zbuild-std` when folks aren't building everything[/+]on Jun 27, 2024
sorry for absconding with your issue @robertbastian but it seems to me that not being able to build std is uhhh expected on a no_std target, even if it might have slightly funny results, whereas "how to steer -Zbuild-std correctly" seems to be inadequately documented for your particular usage, based on your remarks in unicode-org/icu4x#5132
Triage: The job to fix a nicer "UI" for -Zbuild-std belongs to the cargo project. Can someone with sufficient privileges move this to the cargo project please? Thanks!
There was a discussion on Zulip about why people building std for no_std targets. I saw this issue but still confused about the actual use case. Is it just for a simpler CI script setup?
@weihanglo Despite the name -Zbuild-std, it's also quite useful for building libcore, and that's basically the main reason.
Embedded often wants this. For instance, there are cases where there is a target, but its baseline features don't include a feature your CPU has, so you want to rebuild the stdlib, which was compiled against that baseline, against your actual available features.
Activity
bjorn3 commentedon Jun 26, 2024
Isn't thumbv8m.main-none-eabihf (supposed to be) a no_std target? There is no OS such code runs on.
robertbastian commentedon Jun 26, 2024
We're using
-Zbuild-std=stdto get-Zbuild-std-features=panic_immediate_abort. This works on older nightlies but might have changed?robertbastian commentedon Jun 26, 2024
We probably need to use
-Zbuild-std=core,alloc -Zbuild-std-features=panic_immediate_abortDon't build `std` on `no_std` targets (#5132)
[-]unresolved import `crate::sys::thread_local::key::StaticKey`[/-][+]document args for `-Zbuild-std` when folks aren't building everything[/+]workingjubilee commentedon Jun 27, 2024
probably in the unstable book for the option?
workingjubilee commentedon Jun 27, 2024
sorry for absconding with your issue @robertbastian but it seems to me that not being able to build std is uhhh expected on a
no_stdtarget, even if it might have slightly funny results, whereas "how to steer-Zbuild-stdcorrectly" seems to be inadequately documented for your particular usage, based on your remarks in unicode-org/icu4x#5132Enselic commentedon Dec 3, 2024
Triage: The job to fix a nicer "UI" for -Zbuild-std belongs to the cargo project. Can someone with sufficient privileges move this to the cargo project please? Thanks!
workingjubilee commentedon Dec 3, 2024
@rustbot transfer cargo
weihanglo commentedon Dec 4, 2024
There was a discussion on Zulip about why people building std for
no_stdtargets. I saw this issue but still confused about the actual use case. Is it just for a simpler CI script setup?workingjubilee commentedon Dec 4, 2024
@weihanglo Despite the name
-Zbuild-std, it's also quite useful for building libcore, and that's basically the main reason.Embedded often wants this. For instance, there are cases where there is a target, but its baseline features don't include a feature your CPU has, so you want to rebuild the stdlib, which was compiled against that baseline, against your actual available features.
ConnorBP commentedon Jan 15, 2025
Looks like thread locals are messing everyone’s day up huh