-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Always run rustc in a thread #56813
The head ref may contain hidden characters: "main_\u{1F9F6}"
Always run rustc in a thread #56813
Conversation
Please remove |
This comment has been minimized.
This comment has been minimized.
if spawn_thread || env::var_os("RUST_MIN_STACK").is_some() { | ||
// We need a thread for soundness of thread local storage in rustc. For debugging purposes | ||
// we allow an escape hatch where everything runs on the main thread. | ||
if env::var_os("RUSTC_UNSTABLE_NO_MAIN_THREAD").is_none() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the idea of using an environment variable here so undiscoverable that the condition might as well be false
for all intents and purposes…
The manual page for rustc technically has a section on environment variables. Perhaps it would be a good place to document this envvar there as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, does the compiler have a part of its --help -v
output dedicated to environment variables? That might be nice too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(having said that, such additions can wait for a followup PR... lets get this PR in now.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc #45495 (and maybe #44074?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This env var is gone now that #56732 landed.
The implementation looks good to me. |
@bors r+ |
📌 Commit 6b96827 has been approved by |
⌛ Testing commit 6b96827 with merge 890597e8a9d43fec4b2ee71809d27822cb6b4f17... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Always run rustc in a thread cc @ishitatsuyuki @eddyb r? @pnkfelix [Previously](#48575) we moved to only producing threads when absolutely necessary. Even before we opted to only create threads in some cases, which [is unsound](#48575 (comment)) due to the way we use thread local storage.
☀️ Test successful - status-appveyor, status-travis |
In the @rust-lang/compiler meeting today, we decided against backporting this because the problem just doesn't seem that urgent. The bug is in stable already and not many folks have commented on it (it's quite challenging to reproduce). So it can ride the trains as usual, lower risk. (discussion) |
cc @ishitatsuyuki @eddyb
r? @pnkfelix
Previously we moved to only producing threads when absolutely necessary. Even before we opted to only create threads in some cases, which is unsound due to the way we use thread local storage.