From 0b70ab01624dfcf663f56fb43096b193cb5cc217 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 31 Aug 2020 12:42:25 -0700 Subject: [PATCH] Disable RUSTC_BOOTSTRAP in build.rs Closes #7088 --- src/cargo/core/compiler/custom_build.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cargo/core/compiler/custom_build.rs b/src/cargo/core/compiler/custom_build.rs index 6b642392018..7a8298bc005 100644 --- a/src/cargo/core/compiler/custom_build.rs +++ b/src/cargo/core/compiler/custom_build.rs @@ -607,6 +607,13 @@ impl BuildOutput { let mut iter = value.splitn(2, '='); let name = iter.next(); let val = iter.next(); + if name.unwrap_or("").eq_ignore_ascii_case("RUSTC_BOOTSTRAP") { + if crate::core::features::nightly_features_allowed() { + log::warn!("RUSTC_BOOTSTRAP is not supported in build script overrides"); + } else { + anyhow::bail!("RUSTC_BOOTSTRAP is not supported in build script overrides"); + } + } match (name, val) { (Some(n), Some(v)) => Ok((n.to_owned(), v.to_owned())), _ => anyhow::bail!("Variable rustc-env has no value in {}: {}", whence, value),