diff options
| author | onur-ozkan <work@onurozkan.dev> | 2024-02-23 22:41:21 +0300 |
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2024-02-23 22:41:21 +0300 |
| commit | ea476b1fa1cd42f5ee10a4d6cc95d6bbaf63ce86 (patch) | |
| tree | 9044e1a5ed8932fb487d8bdba1a2a8ebeb7b204b | |
| parent | 21033f637e60af61ead04cc296e7214f89c16a95 (diff) | |
| download | rust-ea476b1fa1cd42f5ee10a4d6cc95d6bbaf63ce86.tar.gz rust-ea476b1fa1cd42f5ee10a4d6cc95d6bbaf63ce86.zip | |
on the fly type casting for `build.rustc` and `build.cargo`
Signed-off-by: onur-ozkan <work@onurozkan.dev>
| -rw-r--r-- | src/bootstrap/src/core/config/config.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 834025c8188..3461beba0bd 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -811,8 +811,8 @@ define_config! { host: Option<Vec<String>> = "host", target: Option<Vec<String>> = "target", build_dir: Option<String> = "build-dir", - cargo: Option<String> = "cargo", - rustc: Option<String> = "rustc", + cargo: Option<PathBuf> = "cargo", + rustc: Option<PathBuf> = "rustc", rustfmt: Option<PathBuf> = "rustfmt", docs: Option<bool> = "docs", compiler_docs: Option<bool> = "compiler-docs", @@ -1421,7 +1421,7 @@ impl Config { if !flags.skip_stage0_validation { config.check_stage0_version(&rustc, "rustc"); } - PathBuf::from(rustc) + rustc } else { config.download_beta_toolchain(); config.out.join(config.build.triple).join("stage0/bin/rustc") @@ -1431,7 +1431,7 @@ impl Config { if !flags.skip_stage0_validation { config.check_stage0_version(&cargo, "cargo"); } - PathBuf::from(cargo) + cargo } else { config.download_beta_toolchain(); config.out.join(config.build.triple).join("stage0/bin/cargo") @@ -2292,7 +2292,7 @@ impl Config { } // check rustc/cargo version is same or lower with 1 apart from the building one - pub fn check_stage0_version(&self, program_path: &str, component_name: &'static str) { + pub fn check_stage0_version(&self, program_path: &Path, component_name: &'static str) { if self.dry_run() { return; } @@ -2303,7 +2303,8 @@ impl Config { let stage0_name = stage0_output.next().unwrap(); if stage0_name != component_name { fail(&format!( - "Expected to find {component_name} at {program_path} but it claims to be {stage0_name}" + "Expected to find {component_name} at {} but it claims to be {stage0_name}", + program_path.display() )); } |
