Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bootstrap.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,9 @@
# as libstd features, this option can also be used to configure features such as optimize_for_size.
#rust.std-features = ["panic_unwind"]

# Trigger a `DebugBreak` after an internal compiler error during bootstrap on Windows
#rust.break-on-ice = true

# =============================================================================
# Distribution options
#
Expand Down
7 changes: 5 additions & 2 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,11 @@ impl Builder<'_> {
.env("RUSTC_LIBDIR", libdir)
.env("RUSTDOC", self.bootstrap_out.join("rustdoc"))
.env("RUSTDOC_REAL", rustdoc_path)
.env("RUSTC_ERROR_METADATA_DST", self.extended_error_dir())
.env("RUSTC_BREAK_ON_ICE", "1");
.env("RUSTC_ERROR_METADATA_DST", self.extended_error_dir());

if self.config.rust_break_on_ice {
cargo.env("RUSTC_BREAK_ON_ICE", "1");
}

// Set RUSTC_WRAPPER to the bootstrap shim, which switches between beta and in-tree
// sysroot depending on whether we're building build scripts.
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ pub struct Config {
pub rust_lto: RustcLto,
pub rust_validate_mir_opts: Option<u32>,
pub rust_std_features: BTreeSet<String>,
pub rust_break_on_ice: bool,
pub llvm_profile_use: Option<String>,
pub llvm_profile_generate: bool,
pub llvm_libunwind_default: Option<LlvmLibunwind>,
Expand Down Expand Up @@ -550,6 +551,7 @@ impl Config {
strip: rust_strip,
lld_mode: rust_lld_mode,
std_features: rust_std_features,
break_on_ice: rust_break_on_ice,
} = toml.rust.unwrap_or_default();

let Llvm {
Expand Down Expand Up @@ -1269,6 +1271,7 @@ impl Config {
reproducible_artifacts: flags_reproducible_artifact,
reuse: build_reuse.map(PathBuf::from),
rust_analyzer_info,
rust_break_on_ice: rust_break_on_ice.unwrap_or(true),
rust_codegen_backends: rust_codegen_backends
.map(|backends| parse_codegen_backends(backends, "rust"))
.unwrap_or(vec![CodegenBackendKind::Llvm]),
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/src/core/config/toml/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ define_config! {
lto: Option<String> = "lto",
validate_mir_opts: Option<u32> = "validate-mir-opts",
std_features: Option<BTreeSet<String>> = "std-features",
break_on_ice: Option<bool> = "break-on-ice",
}
}

Expand Down Expand Up @@ -355,6 +356,7 @@ pub fn check_incompatible_options_for_ci_rustc(
download_rustc: _,
validate_mir_opts: _,
frame_pointers: _,
break_on_ice: _,
} = ci_rust_config;

// There are two kinds of checks for CI rustc incompatible options:
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,4 +536,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
summary: "It is no longer possible to `x test` with stage 0, except for running compiletest and opting into `build.compiletest-allow-stage0`.",
},
ChangeInfo {
change_id: 145976,
severity: ChangeSeverity::Info,
summary: "Added a new option `rust.break-on-ice` to control if internal compiler errors cause a debug break on Windows.",
},
];
Loading