about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jnelson@cloudflare.com>2022-05-22 09:44:23 -0500
committerJoshua Nelson <jnelson@cloudflare.com>2022-05-22 09:44:23 -0500
commit751ad4a0e9fc43a9e810cce69d4cef581323e79a (patch)
treedbe985fa3ad70c490d094ea476f993428a44a8cd
parentb0ea4e74cbcb7e4e42f622cda098b95e583f62d9 (diff)
downloadrust-751ad4a0e9fc43a9e810cce69d4cef581323e79a.tar.gz
rust-751ad4a0e9fc43a9e810cce69d4cef581323e79a.zip
Disable unstable features in bootstrap tools
This statically prevents issues like https://github.com/rust-lang/rust/issues/59264,
where tools can only be built with the in-tree compiler and not beta.
-rw-r--r--src/bootstrap/builder.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 2224bf5f66e..68d0d685ebb 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1201,6 +1201,14 @@ impl<'a> Builder<'a> {
         // this), as well as #63012 which is the tracking issue for this
         // feature on the rustc side.
         cargo.arg("-Zbinary-dep-depinfo");
+        match mode {
+            Mode::ToolBootstrap => {
+                // Restrict the allowed features to those passed by rustbuild, so we don't depend on nightly accidentally.
+                // HACK: because anyhow does feature detection in build.rs, we need to allow the backtrace feature too.
+                rustflags.arg("-Zallow-features=binary-dep-depinfo,backtrace");
+            }
+            Mode::Std | Mode::Rustc | Mode::ToolStd | Mode::Codegen | Mode::ToolRustc => {}
+        }
 
         cargo.arg("-j").arg(self.jobs().to_string());
         // Remove make-related flags to ensure Cargo can correctly set things up