Skip to content

Commit 41ac87d

Browse files
committed
Don't set RUSTC in the bootstrap build script
We no longer use this for anything since https://github.com/rust-lang/rust/pull/98483/files#diff-7eddc76f1be9eca2599a9ae58c65ffe247fbdff9b02ef687439894cab9afe749L781. Remove it, so that we spuriously rebuild bootstrap fewer times on Windows (where PATH changes often).
1 parent 4652f5e commit 41ac87d

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

src/bootstrap/build.rs

-36
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,7 @@
1-
use env::consts::{EXE_EXTENSION, EXE_SUFFIX};
21
use std::env;
3-
use std::ffi::OsString;
4-
use std::path::PathBuf;
5-
6-
/// Given an executable called `name`, return the filename for the
7-
/// executable for a particular target.
8-
pub fn exe(name: &PathBuf) -> PathBuf {
9-
if EXE_EXTENSION != "" && name.extension() != Some(EXE_EXTENSION.as_ref()) {
10-
let mut name: OsString = name.clone().into();
11-
name.push(EXE_SUFFIX);
12-
name.into()
13-
} else {
14-
name.clone()
15-
}
16-
}
172

183
fn main() {
194
let host = env::var("HOST").unwrap();
205
println!("cargo:rerun-if-changed=build.rs");
21-
println!("cargo:rerun-if-env-changed=RUSTC");
226
println!("cargo:rustc-env=BUILD_TRIPLE={}", host);
23-
24-
// This may not be a canonicalized path.
25-
let mut rustc = PathBuf::from(env::var_os("RUSTC").unwrap());
26-
27-
if rustc.is_relative() {
28-
println!("cargo:rerun-if-env-changed=PATH");
29-
for dir in env::split_paths(&env::var_os("PATH").unwrap_or_default()) {
30-
let absolute = dir.join(&exe(&rustc));
31-
if absolute.exists() {
32-
rustc = absolute;
33-
break;
34-
}
35-
}
36-
}
37-
assert!(rustc.is_absolute());
38-
39-
// FIXME: if the path is not utf-8, this is going to break. Unfortunately
40-
// Cargo doesn't have a way for us to specify non-utf-8 paths easily, so
41-
// we'll need to invent some encoding scheme if this becomes a problem.
42-
println!("cargo:rustc-env=RUSTC={}", rustc.to_str().unwrap());
437
}

0 commit comments

Comments
 (0)