Skip to content

Commit 9ba3d31

Browse files
committed
Auto merge of #122427 - psumbera:bootstrap_out_path, r=clubby789
Normalize bootstrap_out path Fixes #112785
2 parents 378a43a + feeb184 commit 9ba3d31

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bootstrap/src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,16 @@ impl Build {
376376
.expect("failed to read src/version");
377377
let version = version.trim();
378378

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

0 commit comments

Comments
 (0)