-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Avoid accidentally enabling unstable features in compilers #92261
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
Conversation
This shouldn't have any change in practice, but it seems good to enforce.
(rust-highfive has picked a reviewer for you, use r? to override) |
ca3825c
to
4ea1df8
Compare
This seems correct, but I think it's an incorrect description of the patch? RUSTC_BOOTSTRAP in this PR's diff is affecting the invocation of bootstrap (i.e., running target/debug/bootstrap), as far as I can tell, not the If you want to expand this patch, it would be good to adjust RUSTC_BOOTSTRAP being set in src/bootstrap/builder.rs to not do so for ToolBootstrap which shouldn't be using unstable features. Though that I think will currently fail due to feature(test) in compiletest, so maybe just a FIXME on that line is a good idea to start. |
No, we set compiletest as a Line 365 in f624427
Lines 338 to 342 in f624427
Instead it fails because bootstrap unconditionally passes
I don't know why binary-dep-depinfo is used; there's a comment but I haven't bothered to follow up on the PR links. Lines 1124 to 1135 in f624427
|
anyway, if you want to follow up on that, you can reproduce the error with diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 4f88b5854b6..74419605ec6 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1378,7 +1378,12 @@ pub fn cargo(
}
// Enable usage of unstable features
- cargo.env("RUSTC_BOOTSTRAP", "1");
+ match mode {
+ Mode::ToolBootstrap => {}
+ Mode::Std | Mode::Rustc | Mode::ToolStd | Mode::Codegen | Mode::ToolRustc => {
+ cargo.env("RUSTC_BOOTSTRAP", "1");
+ }
+ }
self.add_rust_test_threads(&mut cargo);
// Almost all of the crates that we compile as part of the bootstrap may I'm not planning to spend much time on it. |
Yeah, OK. So it seems like this patch probably doesn't really change much (since we internally unconditionally set bootstrap for cargo invocations anyway). Regardless, it feels like it is the right thing to do, and if there's a long-tail of RUSTC_BOOTSTRAP that we need to add, seems like it's ultimately good to know where that's getting passed down. @bors r+ |
📌 Commit 4ea1df8 has been approved by |
also, setting
|
…=Mark-Simulacrum Avoid accidentally enabling unstable features in compilers This allows rustbuild to control whether crates can use nightly features or not. In practice, it has no effect because `builder.rs` already sets RUSTC_BOOTSTRAP unconditionally.
@bors r- |
Wasn't able to reproduce this locally. Don't know why it's failing. |
…=Mark-Simulacrum Avoid accidentally enabling unstable features in compilers (take 2) This allows rustbuild to control whether crates can use nightly features or not. It also prevents rustbuild from using nightly features itself. This is rust-lang#92261, but I fixed the CI error.
This allows rustbuild to control whether crates can use nightly features or not.
In practice, it has no effect because
builder.rs
already sets RUSTC_BOOTSTRAP unconditionally.