Skip to content

Commit

Permalink
use utils::helpers::exe
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Jul 10, 2024
1 parent b4b2643 commit 9cd1d25
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1451,11 +1451,6 @@ impl Config {
config.out = crate::utils::helpers::absolute(&config.out);
}

// Hacky way to determine the executable suffix for the build target. We cannot use
// std::env::consts::EXE_SUFFIX as the build target might not be the target bootstrap was
// compiled with.
let initial_exe_suffix = if config.build.triple.contains("windows") { ".exe" } else { "" };

config.initial_rustc = if let Some(rustc) = rustc {
if !flags.skip_stage0_validation {
config.check_stage0_version(&rustc, "rustc");
Expand All @@ -1468,7 +1463,7 @@ impl Config {
.join(config.build.triple)
.join("stage0")
.join("bin")
.join(format!("rustc{initial_exe_suffix}"))
.join(exe("rustc", config.build))
};

config.initial_cargo = if let Some(cargo) = cargo {
Expand All @@ -1483,7 +1478,7 @@ impl Config {
.join(config.build.triple)
.join("stage0")
.join("bin")
.join(format!("cargo{initial_exe_suffix}"))
.join(exe("cargo", config.build))
};

// NOTE: it's important this comes *after* we set `initial_rustc` just above.
Expand Down

0 comments on commit 9cd1d25

Please sign in to comment.