From 2b71f3836947d4fd0f633ca460cef2a793b98f64 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 5 Jun 2025 07:28:44 +0300 Subject: [PATCH 1/3] add new config: `rust.download_rustc_incompatibility_check` Signed-off-by: onur-ozkan --- src/bootstrap/src/core/config/config.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 03044d4fc804a..c001dac71238e 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -423,6 +423,9 @@ pub struct Config { /// Cache for determining path modifications pub path_modification_cache: Arc, PathFreshness>>>, + + /// Whether to check and detect incompatible options when using download-rustc. + pub download_rustc_incompatibility_check: bool, } #[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] @@ -1315,6 +1318,7 @@ define_config! { profile_use: Option = "profile-use", // ignored; this is set from an env var set by bootstrap.py download_rustc: Option = "download-rustc", + download_rustc_incompatibility_check: Option = "download-rustc-incompatibility-check", lto: Option = "lto", validate_mir_opts: Option = "validate-mir-opts", std_features: Option> = "std-features", @@ -2041,6 +2045,7 @@ impl Config { strip, lld_mode, std_features: std_features_toml, + download_rustc_incompatibility_check, } = rust; // FIXME(#133381): alt rustc builds currently do *not* have rustc debug assertions @@ -2086,6 +2091,8 @@ impl Config { debuginfo_level_std = debuginfo_level_std_toml; debuginfo_level_tools = debuginfo_level_tools_toml; debuginfo_level_tests = debuginfo_level_tests_toml; + config.download_rustc_incompatibility_check = + download_rustc_incompatibility_check.unwrap_or(true); lld_enabled = lld_enabled_toml; std_features = std_features_toml; @@ -2789,7 +2796,7 @@ impl Config { } } - if let Some(config_path) = &self.config { + if let Some(config_path) = &self.config && self.download_rustc_incompatibility_check { let ci_config_toml = match self.get_builder_toml("ci-rustc") { Ok(ci_config_toml) => ci_config_toml, Err(e) if e.to_string().contains("unknown field") => { @@ -3555,6 +3562,7 @@ fn check_incompatible_options_for_ci_rustc( download_rustc: _, validate_mir_opts: _, frame_pointers: _, + download_rustc_incompatibility_check: _, } = ci_rust_config; // There are two kinds of checks for CI rustc incompatible options: From 7c9fbda8d793b01c64e4df6fefaa4fc81b896e1a Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 5 Jun 2025 07:34:42 +0300 Subject: [PATCH 2/3] add change-tracker Signed-off-by: onur-ozkan --- src/bootstrap/src/utils/change_tracker.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 459a34d14cc4c..73752aa40bfec 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -416,4 +416,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Warning, summary: "Stage0 library no longer matches the in-tree library, which means stage1 compiler now uses the beta library.", }, + ChangeInfo { + change_id: 142055, + severity: ChangeSeverity::Info, + summary: "Added a new option `rust.download_rustc_incompatibility_check`: it is now possible to disable the config incompatibility check for `download-rustc` usage.", + }, ]; From 925af1af805ad38e573a8552b875f3aec1ea601b Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 5 Jun 2025 07:35:51 +0300 Subject: [PATCH 3/3] document `download_rustc_incompatibility_check` in `bootstrap.example.toml` Signed-off-by: onur-ozkan --- bootstrap.example.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bootstrap.example.toml b/bootstrap.example.toml index 1371fd6442f96..4a422305e7da9 100644 --- a/bootstrap.example.toml +++ b/bootstrap.example.toml @@ -546,6 +546,9 @@ # compiler. #download-rustc = false +# Whether to check and detect incompatible options when using download-rustc. +#download_rustc_incompatibility_check = true + # Number of codegen units to use for each compiler invocation. A value of 0 # means "the number of cores on this machine", and 1+ is passed through to the # compiler.