Skip to content

Commit

Permalink
Rollup merge of rust-lang#130138 - Zalathar:initial-libdir, r=albertl…
Browse files Browse the repository at this point in the history
…arsan68

bootstrap: Print more debug info when `find_initial_libdir` fails

From looking at the failure messages printed by rust-lang#129775, my hypothesis is that `rustc --print=sysroot` sometimes prints the wrong path when the rustc executable is hardlinked in multiple places, at least on my macOS system.

However, currently I don't have any concrete evidence of this actually happening. This PR therefore expands on rust-lang#129775 by printing even more information on failure (including the actual rustc path), in the hope that when the failure next occurs we can confirm or reject the hypothesis that `rustc --print=sysroot` is printing the wrong path.
  • Loading branch information
Zalathar authored Sep 14, 2024
2 parents 507c05b + a21f395 commit 2bf0dd2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,14 @@ impl Build {
};
let Some(initial_libdir) = find_initial_libdir() else {
panic!(
"couldn't determine `initial_libdir` \
from target dir {initial_target_dir:?} \
and sysroot {initial_sysroot:?}"
)
"couldn't determine `initial_libdir`:
- config.initial_rustc: {rustc:?}
- initial_target_libdir_str: {initial_target_libdir_str:?}
- initial_target_dir: {initial_target_dir:?}
- initial_sysroot: {initial_sysroot:?}
",
rustc = config.initial_rustc,
);
};

let version = std::fs::read_to_string(src.join("src").join("version"))
Expand Down

0 comments on commit 2bf0dd2

Please sign in to comment.