diff options
| author | onur-ozkan <work@onurozkan.dev> | 2024-08-14 08:06:50 +0300 |
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2024-08-14 08:06:50 +0300 |
| commit | 43320d5d6c53d506bfedff3abde40a9e26b0441a (patch) | |
| tree | 58dd1b83572d5e19dbffa1c3f162c624942de690 | |
| parent | b76f6a3b1a5124e4ade1e54299e74e3026192196 (diff) | |
| download | rust-43320d5d6c53d506bfedff3abde40a9e26b0441a.tar.gz rust-43320d5d6c53d506bfedff3abde40a9e26b0441a.zip | |
do not check incompatibility if `config.toml` isn't present
Signed-off-by: onur-ozkan <work@onurozkan.dev>
| -rw-r--r-- | src/bootstrap/src/core/config/config.rs | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 6dc3e69d8ba..b955593ecf6 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -2320,27 +2320,29 @@ impl Config { Some(commit) => { self.download_ci_rustc(commit); - let builder_config_path = - self.out.join(self.build.triple).join("ci-rustc/builder-config"); - let ci_config_toml = Self::get_toml(&builder_config_path); - let current_config_toml = Self::get_toml(self.config.as_ref().unwrap()); - - // Check the config compatibility - let res = check_incompatible_options_for_ci_rustc( - current_config_toml, - ci_config_toml, - ); + if let Some(config_path) = &self.config { + let builder_config_path = + self.out.join(self.build.triple).join("ci-rustc/builder-config"); + let ci_config_toml = Self::get_toml(&builder_config_path); + let current_config_toml = Self::get_toml(config_path); + + // Check the config compatibility + let res = check_incompatible_options_for_ci_rustc( + current_config_toml, + ci_config_toml, + ); - let disable_ci_rustc_if_incompatible = - env::var_os("DISABLE_CI_RUSTC_IF_INCOMPATIBLE") + let disable_ci_rustc_if_incompatible = + env::var_os("DISABLE_CI_RUSTC_IF_INCOMPATIBLE") .is_some_and(|s| s == "1" || s == "true"); - if disable_ci_rustc_if_incompatible && res.is_err() { - println!("WARNING: download-rustc is disabled with `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` env."); - return None; - } + if disable_ci_rustc_if_incompatible && res.is_err() { + println!("WARNING: download-rustc is disabled with `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` env."); + return None; + } - res.unwrap(); + res.unwrap(); + } Some(commit.clone()) } |
