Skip to content

Commit 751ad4a

Browse files
committed
Disable unstable features in bootstrap tools
This statically prevents issues like #59264, where tools can only be built with the in-tree compiler and not beta.
1 parent b0ea4e7 commit 751ad4a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/bootstrap/builder.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,14 @@ impl<'a> Builder<'a> {
12011201
// this), as well as #63012 which is the tracking issue for this
12021202
// feature on the rustc side.
12031203
cargo.arg("-Zbinary-dep-depinfo");
1204+
match mode {
1205+
Mode::ToolBootstrap => {
1206+
// Restrict the allowed features to those passed by rustbuild, so we don't depend on nightly accidentally.
1207+
// HACK: because anyhow does feature detection in build.rs, we need to allow the backtrace feature too.
1208+
rustflags.arg("-Zallow-features=binary-dep-depinfo,backtrace");
1209+
}
1210+
Mode::Std | Mode::Rustc | Mode::ToolStd | Mode::Codegen | Mode::ToolRustc => {}
1211+
}
12041212

12051213
cargo.arg("-j").arg(self.jobs().to_string());
12061214
// Remove make-related flags to ensure Cargo can correctly set things up

0 commit comments

Comments
 (0)