Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize bootstrap_out path #122427

Merged
merged 1 commit into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,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