@@ -2320,27 +2320,29 @@ impl Config {
2320
2320
Some ( commit) => {
2321
2321
self . download_ci_rustc ( commit) ;
2322
2322
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
+ ) ;
2333
2334
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" )
2336
2337
. is_some_and ( |s| s == "1" || s == "true" ) ;
2337
2338
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
+ }
2342
2343
2343
- res. unwrap ( ) ;
2344
+ res. unwrap ( ) ;
2345
+ }
2344
2346
2345
2347
Some ( commit. clone ( ) )
2346
2348
}
0 commit comments