mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 03:38:29 +00:00
bootstrap: make rust.debug-assertions = true
inhibit downloading CI rustc
Warn if `rust.download-rustc = true` is used with `rust.debug-assertions` as alt CI rustc is not currently built with debug assertions (not to be confused with LLVM assertions).
This commit is contained in:
parent
aafd56b87a
commit
835f5f0f39
@ -1771,8 +1771,37 @@ impl Config {
|
|||||||
std_features: std_features_toml,
|
std_features: std_features_toml,
|
||||||
} = rust;
|
} = rust;
|
||||||
|
|
||||||
config.download_rustc_commit =
|
// FIXME(#133381): alt rustc builds currently do *not* have rustc debug assertions
|
||||||
config.download_ci_rustc_commit(download_rustc, config.llvm_assertions);
|
// enabled. We should not download a CI alt rustc if we need rustc to have debug
|
||||||
|
// assertions (e.g. for crashes test suite). This can be changed once something like
|
||||||
|
// [Enable debug assertions on alt
|
||||||
|
// builds](https://github.com/rust-lang/rust/pull/131077) lands.
|
||||||
|
//
|
||||||
|
// Note that `rust.debug = true` currently implies `rust.debug-assertions = true`!
|
||||||
|
//
|
||||||
|
// This relies also on the fact that the global default for `download-rustc` will be
|
||||||
|
// `false` if it's not explicitly set.
|
||||||
|
let debug_assertions_requested = matches!(rustc_debug_assertions_toml, Some(true))
|
||||||
|
|| (matches!(debug_toml, Some(true))
|
||||||
|
&& !matches!(rustc_debug_assertions_toml, Some(false)));
|
||||||
|
|
||||||
|
if debug_assertions_requested {
|
||||||
|
if let Some(ref opt) = download_rustc {
|
||||||
|
if opt.is_string_or_true() {
|
||||||
|
eprintln!(
|
||||||
|
"WARN: currently no CI rustc builds have rustc debug assertions \
|
||||||
|
enabled. Please either set `rust.debug-assertions` to `false` if you \
|
||||||
|
want to use download CI rustc or set `rust.download-rustc` to `false`."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
config.download_rustc_commit = config.download_ci_rustc_commit(
|
||||||
|
download_rustc,
|
||||||
|
debug_assertions_requested,
|
||||||
|
config.llvm_assertions,
|
||||||
|
);
|
||||||
|
|
||||||
debug = debug_toml;
|
debug = debug_toml;
|
||||||
rustc_debug_assertions = rustc_debug_assertions_toml;
|
rustc_debug_assertions = rustc_debug_assertions_toml;
|
||||||
@ -2778,6 +2807,7 @@ impl Config {
|
|||||||
fn download_ci_rustc_commit(
|
fn download_ci_rustc_commit(
|
||||||
&self,
|
&self,
|
||||||
download_rustc: Option<StringOrBool>,
|
download_rustc: Option<StringOrBool>,
|
||||||
|
debug_assertions_requested: bool,
|
||||||
llvm_assertions: bool,
|
llvm_assertions: bool,
|
||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
if !is_download_ci_available(&self.build.triple, llvm_assertions) {
|
if !is_download_ci_available(&self.build.triple, llvm_assertions) {
|
||||||
@ -2786,9 +2816,9 @@ impl Config {
|
|||||||
|
|
||||||
// If `download-rustc` is not set, default to rebuilding.
|
// If `download-rustc` is not set, default to rebuilding.
|
||||||
let if_unchanged = match download_rustc {
|
let if_unchanged = match download_rustc {
|
||||||
// Globally default for `download-rustc` to `false`, because some contributors don't use
|
// Globally default `download-rustc` to `false`, because some contributors don't use
|
||||||
// profiles for reasons such as:
|
// profiles for reasons such as:
|
||||||
// - They need to seemlessly switch between compiler/library work.
|
// - They need to seamlessly switch between compiler/library work.
|
||||||
// - They don't want to use compiler profile because they need to override too many
|
// - They don't want to use compiler profile because they need to override too many
|
||||||
// things and it's easier to not use a profile.
|
// things and it's easier to not use a profile.
|
||||||
None | Some(StringOrBool::Bool(false)) => return None,
|
None | Some(StringOrBool::Bool(false)) => return None,
|
||||||
@ -2849,6 +2879,14 @@ impl Config {
|
|||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if debug_assertions_requested {
|
||||||
|
eprintln!(
|
||||||
|
"WARN: `rust.debug-assertions = true` will prevent downloading CI rustc as alt CI \
|
||||||
|
rustc is not currently built with debug assertions."
|
||||||
|
);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
Some(commit)
|
Some(commit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user