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

Fix bootstrap failing to copy rust-llvm-dwp when cross-compiling rustc #91270

Closed
wants to merge 3 commits into from

Conversation

jam1garner
Copy link
Contributor

Fixes #85593

r? @jyn514

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 26, 2021
src/bootstrap/compile.rs Outdated Show resolved Hide resolved
builder.copy(&llvm_bin_dir.join(&src_exe), &libdir_bin.join(&dst_exe));
} else {
// if cross-compiling don't copy the llvm directory for the target instead
let llvm_bin_dir = format!("build/{}/llvm/build/bin", target_compiler.host);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, would this work for the host too? It would be nice to do this unconditionally instead of making it different, people use download-ci-llvm a lot so this means it would get a lot more testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better not to, as technically if not cross-compiling it's more correct to use llvm-config to have llvm get the path to itself (which, while better, isn't possible when the host and the target aren't the same)

@jyn514 jyn514 added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Nov 26, 2021
@jyn514
Copy link
Member

jyn514 commented Nov 27, 2021

This looks good to me - @Mark-Simulacrum do you want to take a look or should I just approve myself?

} else {
// if cross-compiling don't copy from the llvm directory for the target instead
builder.llvm_out(target_compiler.host).join("build/bin")
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I admit I may just be confused -- but it feels like llvm_bin_dir should ~match with llvm_config_bin returned from native::Llvm invocation? In particular, I would expect llvm-config to be in the same directory as llvm-dwp. So maybe we should skip the --bindir invocation regardless of cross-compilation and just copy llvm_config_bin.with_filename(src_exe)?

If that doesn't work -- presumably for the reason we started invoking bindir here -- it would be good to figure out why. Because it seems like the new code makes the assumption that it should work, which can then presumably fail for whatever reason we started using --bindir.

In some sense I guess this gets at "why does --bindir not work for cross-compilation"?

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 29, 2021
@apiraino apiraino added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Dec 1, 2021
@crlf0710
Copy link
Member

@jam1garner Ping from triage, any updates on this?

@jam1garner
Copy link
Contributor Author

@jam1garner Ping from triage, any updates on this?

At this point, my usecase for this fix has shifted off months ago (not long after my original issue) and I'm not confident in my ability to test how any larger changes to the fix would work, so I'd personally be in favor of closing the PR and it just being reference material if anyone hits this issue again.

The effort it'd take to recreate the original circumstances just aren't justified by the value of the patch to me personally. Was only able to comply with changes to the patchset this far due to being able to test for equivalent behavior in a vacuum, but I think the proposed rework would exceed that.

Not going to close it myself in case others disagree with that being the course of action to take. I appreciate the effort by Mark and Joshua to review my fix, and sorry for not still having access to the build infrastructure needed to test further fixes.

If anyone down the road hitting this issue needs anything from me feel free to contact me here, on Zulip, on Twitter, or by email. (In order of preference)

@jyn514 jyn514 closed this Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bootstrap unable to copy rust-llvm-dwp when cross compiling rustc
6 participants