This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -901,9 +901,7 @@ impl Config {
901901 config. config = toml_path;
902902
903903 let build = toml. build . unwrap_or_default ( ) ;
904- let has_custom_rustc = build. rustc . is_some ( ) ;
905904
906- set ( & mut config. initial_rustc , build. rustc . map ( PathBuf :: from) ) ;
907905 set ( & mut config. out , flags. build_dir . or_else ( || build. build_dir . map ( PathBuf :: from) ) ) ;
908906 // NOTE: Bootstrap spawns various commands with different working directories.
909907 // To avoid writing to random places on the file system, `config.out` needs to be an absolute path.
@@ -912,10 +910,14 @@ impl Config {
912910 config. out = crate :: util:: absolute ( & config. out ) ;
913911 }
914912
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" ) ) ;
919921
920922 // NOTE: it's important this comes *after* we set `initial_rustc` just above.
921923 if config. dry_run {
You can’t perform that action at this time.
0 commit comments