File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -901,9 +901,7 @@ impl Config {
901
901
config. config = toml_path;
902
902
903
903
let build = toml. build . unwrap_or_default ( ) ;
904
- let has_custom_rustc = build. rustc . is_some ( ) ;
905
904
906
- set ( & mut config. initial_rustc , build. rustc . map ( PathBuf :: from) ) ;
907
905
set ( & mut config. out , flags. build_dir . or_else ( || build. build_dir . map ( PathBuf :: from) ) ) ;
908
906
// NOTE: Bootstrap spawns various commands with different working directories.
909
907
// To avoid writing to random places on the file system, `config.out` needs to be an absolute path.
@@ -912,10 +910,14 @@ impl Config {
912
910
config. out = crate :: util:: absolute ( & config. out ) ;
913
911
}
914
912
915
- if !has_custom_rustc && !config. initial_rustc . starts_with ( & config. out ) {
916
- config. initial_rustc = config. out . join ( config. build . triple ) . join ( "stage0/bin/rustc" ) ;
917
- config. initial_cargo = config. out . join ( config. build . triple ) . join ( "stage0/bin/cargo" ) ;
918
- }
913
+ config. initial_rustc = build
914
+ . rustc
915
+ . map ( PathBuf :: from)
916
+ . unwrap_or_else ( || config. out . join ( config. build . triple ) . join ( "stage0/bin/rustc" ) ) ;
917
+ config. initial_cargo = build
918
+ . cargo
919
+ . map ( PathBuf :: from)
920
+ . unwrap_or_else ( || config. out . join ( config. build . triple ) . join ( "stage0/bin/cargo" ) ) ;
919
921
920
922
// NOTE: it's important this comes *after* we set `initial_rustc` just above.
921
923
if config. dry_run {
You can’t perform that action at this time.
0 commit comments