-
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
Cargo prints rustc's stderr twice #4223
Comments
Hm, this is probably a regression: I remember seeing a similar problem with nightly Cargo recently, while stable printed error only once. I think this happened around after #4029. |
Ah yeah Cargo shouldn't ever print anything out twice here! @Mark-Simulacrum I think you hit the nail head on. My preferred fix for this would be to stream output but not capture it. That way you get errors and other diagnostics as they come and we shouldn't duplicate anything. |
I'll file a PR soon, hopefully. |
Prevent rustc stderr/stdout from being duplicated. Please review carefully. I've not submitted patches to Cargo before, I think, so this may be flawed in some way I haven't detected yet. Tests are green locally, though. Fixes #4223
Due to a bug (rust-lang/cargo#4223), Rust was displaying the stdout of the compiler, causing the parsing code to get confused. Also, update tests for 1.19 message changes, and deprecation of no-trans.
* Add global Cargo settings for all packages. * Fix a bug building with Rust 1.19. Due to a bug (rust-lang/cargo#4223), Rust was displaying the stdout of the compiler, causing the parsing code to get confused. Also, update tests for 1.19 message changes, and deprecation of no-trans.
* Add global Cargo settings for all packages. * Fix a bug building with Rust 1.19. Due to a bug (rust-lang/cargo#4223), Rust was displaying the stdout of the compiler, causing the parsing code to get confused. Also, update tests for 1.19 message changes, and deprecation of no-trans.
There seems to be a regression on this with |
@flavius Can you file a new issue with a reproduction? |
This is primarily a problem for those who use this output and pipe to editors to jump from error to error. The cause of this is the fact that Cargo uses
exec_with_streaming
insideexec_json
, and passes this stderror handler in. That prints out stderr upon receiving each line, which is fine -- we should do this. However, exec_with_streaming also saves this data here. This output is later printed in "process didn't execute successfully," leading to duplication of the stderr for the compiler.Arguably, none of these individually are bad, but together they don't lead to optimal behavior. I think the easiest and most straightforward fix here is to add a flag to exec_with_streaming that prevents printing stderr when the command fails and pass it in from cargo_rustc.
cc @alexcrichton
cc @eddyb -- you asked on IRC about this
The text was updated successfully, but these errors were encountered: