Skip to content

Commit 43320d5

Browse files
committed
do not check incompatibility if config.toml isn't present
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent b76f6a3 commit 43320d5

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
@@ -2320,27 +2320,29 @@ impl Config {
23202320
Some(commit) => {
23212321
self.download_ci_rustc(commit);
23222322

2323-
let builder_config_path =
2324-
self.out.join(self.build.triple).join("ci-rustc/builder-config");
2325-
let ci_config_toml = Self::get_toml(&builder_config_path);
2326-
let current_config_toml = Self::get_toml(self.config.as_ref().unwrap());
2327-
2328-
// Check the config compatibility
2329-
let res = check_incompatible_options_for_ci_rustc(
2330-
current_config_toml,
2331-
ci_config_toml,
2332-
);
2323+
if let Some(config_path) = &self.config {
2324+
let builder_config_path =
2325+
self.out.join(self.build.triple).join("ci-rustc/builder-config");
2326+
let ci_config_toml = Self::get_toml(&builder_config_path);
2327+
let current_config_toml = Self::get_toml(config_path);
2328+
2329+
// Check the config compatibility
2330+
let res = check_incompatible_options_for_ci_rustc(
2331+
current_config_toml,
2332+
ci_config_toml,
2333+
);
23332334

2334-
let disable_ci_rustc_if_incompatible =
2335-
env::var_os("DISABLE_CI_RUSTC_IF_INCOMPATIBLE")
2335+
let disable_ci_rustc_if_incompatible =
2336+
env::var_os("DISABLE_CI_RUSTC_IF_INCOMPATIBLE")
23362337
.is_some_and(|s| s == "1" || s == "true");
23372338

2338-
if disable_ci_rustc_if_incompatible && res.is_err() {
2339-
println!("WARNING: download-rustc is disabled with `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` env.");
2340-
return None;
2341-
}
2339+
if disable_ci_rustc_if_incompatible && res.is_err() {
2340+
println!("WARNING: download-rustc is disabled with `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` env.");
2341+
return None;
2342+
}
23422343

2343-
res.unwrap();
2344+
res.unwrap();
2345+
}
23442346

23452347
Some(commit.clone())
23462348
}

0 commit comments

Comments
 (0)