-
Notifications
You must be signed in to change notification settings - Fork 1k
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
build.rs: print rustc stderr if exit status != 0 #3180
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
@bors r+ |
build.rs: print rustc stderr if exit status != 0 I was trying to run benchmarks locally with rustc-perf and found that many of them failed to build with a message from libc's build.rs "Failed to get rustc version." I made this change locally to help debug, and I think it would be generally useful. In my case it quickly revealed that rustc was failing to find libLLVM and so `rustc --version` was emitting nothing on stdout. I think this may have been part of what was intended with #3000 and might help debug rust-lang/crater#663.
💔 Test failed - checks-actions |
build.rs
Outdated
@@ -181,6 +181,11 @@ fn rustc_minor_nightly() -> (u32, bool) { | |||
.output() | |||
.ok() | |||
.expect("Failed to get rustc version"); | |||
if !output.status.success() { | |||
let stderr = std::string::String::from_utf8_lossy(output.stderr.as_slice()); | |||
eprintln!("failed to run rustc: {stderr}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This syntax doesn't work on old rustc.
88e27b8
to
52808ce
Compare
@bors r+ |
build.rs: print rustc stderr if exit status != 0 I was trying to run benchmarks locally with rustc-perf and found that many of them failed to build with a message from libc's build.rs "Failed to get rustc version." I made this change locally to help debug, and I think it would be generally useful. In my case it quickly revealed that rustc was failing to find libLLVM and so `rustc --version` was emitting nothing on stdout. I think this may have been part of what was intended with #3000 and might help debug rust-lang/crater#663.
💔 Test failed - checks-actions |
It looks like the nightly freebsd tests are failing with:
Which I suspect is unrelated to this change. |
Note that you saw the build on PRs, not bors. The bors' build is here: https://cirrus-ci.com/build/5602401026048000 It's a network failure which means we should: @bors retry |
☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14 |
I was trying to run benchmarks locally with rustc-perf and found that many of them failed to build with a message from libc's build.rs "Failed to get rustc version." I made this change locally to help debug, and I think it would be generally useful. In my case it quickly revealed that rustc was failing to find libLLVM and so
rustc --version
was emitting nothing on stdout.I think this may have been part of what was intended with #3000 and might help debug rust-lang/crater#663.