Skip to content

Commit

Permalink
Rollup merge of rust-lang#94409 - RalfJung:path, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
avoid rebuilding bootstrap when PATH changes

Fixes rust-lang#94408

r? ``@Mark-Simulacrum``
  • Loading branch information
matthiaskrgr authored Feb 27, 2022
2 parents fe47628 + 35e3aaf commit 1bae4d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use std::path::PathBuf;
fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=RUSTC");
println!("cargo:rerun-if-env-changed=PATH");
println!("cargo:rustc-env=BUILD_TRIPLE={}", env::var("HOST").unwrap());

// This may not be a canonicalized path.
let mut rustc = PathBuf::from(env::var_os("RUSTC").unwrap());

if rustc.is_relative() {
println!("cargo:rerun-if-env-changed=PATH");
for dir in env::split_paths(&env::var_os("PATH").unwrap_or_default()) {
let absolute = dir.join(&rustc);
if absolute.exists() {
Expand Down

0 comments on commit 1bae4d5

Please sign in to comment.