Skip to content

Commit

Permalink
Auto merge of rust-lang#122427 - psumbera:bootstrap_out_path, r=clubb…
Browse files Browse the repository at this point in the history
…y789

Normalize bootstrap_out path

Fixes rust-lang#112785
  • Loading branch information
bors committed May 1, 2024
2 parents 378a43a + feeb184 commit 9ba3d31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,16 @@ impl Build {
.expect("failed to read src/version");
let version = version.trim();

let bootstrap_out = std::env::current_exe()
let mut bootstrap_out = std::env::current_exe()
.expect("could not determine path to running process")
.parent()
.unwrap()
.to_path_buf();
// Since bootstrap is hardlink to deps/bootstrap-*, Solaris can sometimes give
// path with deps/ which is bad and needs to be avoided.
if bootstrap_out.ends_with("deps") {
bootstrap_out.pop();
}
if !bootstrap_out.join(exe("rustc", config.build)).exists() && !cfg!(test) {
// this restriction can be lifted whenever https://github.com/rust-lang/rfcs/pull/3028 is implemented
panic!(
Expand Down

0 comments on commit 9ba3d31

Please sign in to comment.