Skip to content

Commit b0c7cd6

Browse files
onur-ozkanrezwanahmedsami
authored andcommitted
do not check incompatibility if config.toml isn't present
Signed-off-by: onur-ozkan <[email protected]>
1 parent b6fb99a commit b0c7cd6

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,27 +2332,29 @@ impl Config {
23322332
Some(commit) => {
23332333
self.download_ci_rustc(commit);
23342334

2335-
let builder_config_path =
2336-
self.out.join(self.build.triple).join("ci-rustc/builder-config");
2337-
let ci_config_toml = Self::get_toml(&builder_config_path);
2338-
let current_config_toml = Self::get_toml(self.config.as_ref().unwrap());
2339-
2340-
// Check the config compatibility
2341-
let res = check_incompatible_options_for_ci_rustc(
2342-
current_config_toml,
2343-
ci_config_toml,
2344-
);
2335+
if let Some(config_path) = &self.config {
2336+
let builder_config_path =
2337+
self.out.join(self.build.triple).join("ci-rustc/builder-config");
2338+
let ci_config_toml = Self::get_toml(&builder_config_path);
2339+
let current_config_toml = Self::get_toml(config_path);
2340+
2341+
// Check the config compatibility
2342+
let res = check_incompatible_options_for_ci_rustc(
2343+
current_config_toml,
2344+
ci_config_toml,
2345+
);
23452346

2346-
let disable_ci_rustc_if_incompatible =
2347-
env::var_os("DISABLE_CI_RUSTC_IF_INCOMPATIBLE")
2347+
let disable_ci_rustc_if_incompatible =
2348+
env::var_os("DISABLE_CI_RUSTC_IF_INCOMPATIBLE")
23482349
.is_some_and(|s| s == "1" || s == "true");
23492350

2350-
if disable_ci_rustc_if_incompatible && res.is_err() {
2351-
println!("WARNING: download-rustc is disabled with `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` env.");
2352-
return None;
2353-
}
2351+
if disable_ci_rustc_if_incompatible && res.is_err() {
2352+
println!("WARNING: download-rustc is disabled with `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` env.");
2353+
return None;
2354+
}
23542355

2355-
res.unwrap();
2356+
res.unwrap();
2357+
}
23562358

23572359
Some(commit.clone())
23582360
}

0 commit comments

Comments
 (0)