-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
report status to stderr instead of stdout #2693
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
... on the stable compiler. There should be even for failures for nightly |
Will help to fix [cargo-issue] [cargo-issue]: rust-lang/cargo#2693
Will help to fix [cargo-issue] [cargo-issue]: rust-lang/cargo#2693
91 failures left :) |
Hm, I found an interesting phenomena: some tests before this changed asserted |
@matklad yeah that's probably a split between "intentionally ignored", "too lazy to write out the output", or "oops forgot to assert that output". It should be fine to either add the assertions or switch to Also cc @rust-lang/tools, a somewhat large-ish semantic change to Cargo! |
Nice, I indeed feel a little uneasy because of the scope of the change (Although I personally think that stderr is the right stream for the status messages). I'll then wait for an explicit approval before I continue fixing the tests :) |
+1 for more disciplined use of stderr/out |
I agree that stderr is the right place for status messages. How will this affect |
@brson in theory it won't affect |
Discussed during tools triage we were all on board, so let's do this! Wanna fix up the few remaining tests @matklad and I'll merge? |
Yeah, I'll do it, but I can't give a precise ETA (this weak perheps?). The remaining tests most likely all require some manual intervention. |
Ah yeah no worries, and if you run out of time I can help out as well |
@@ -722,7 +722,7 @@ test!(dev_deps_no_rebuild_lib { | |||
"#) | |||
.file("src/lib.rs", r#" | |||
#[cfg(test)] extern crate bar; | |||
#[cfg(not(test))] fn foo() { env!("FOO"); } | |||
#[cfg(not(test))] pub fn foo() { env!("FOO"); } |
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.
@alexcrichton this tests looks a bit strange. Looks like it should set and read an environmental variable, but it actually is never asserted (and "unused function foo" is printed during the compilation).
Perhaps the test doesn't test what it is supposed to?
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.
I believe the env!
macro fails compilation if the env var isn't defined
@alexcrichton I think I have fixed all the tests except the cross compile ones (one does not simply link stuff on nixos :) ). Can you please finish the work here? I think the commits should be squashed before merge, but it may be simpler to review them one by one. |
Report status to stderr -- last few tests Fixup of #2693 for the last few tests.
All status messages are printed to stderr instead of stdout now.
This changes exactly three letters of code and breaks 211 tests 😨
I will hopefully fix all the tests here, but I decided to submit PR early in case somebody comes up with a less laborious way to do this.
Fixes #1473, #2661