Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCargo output could go to stderr #1473
Comments
This comment has been minimized.
This comment has been minimized.
|
cc #653, a possible solution to the problem proposed there. |
This comment has been minimized.
This comment has been minimized.
|
It does seem odd, though, to print informational output to stderr. Do other CLI tools have a habit of doing this? |
This comment has been minimized.
This comment has been minimized.
|
+1. I don't know about |
This comment has been minimized.
This comment has been minimized.
|
Having trouble thinking of tools that run a subcommand and also print informative output. A data point for a similar use Bazel always sends its informational output to stderr, for whether for A historical aside, |
This comment has been minimized.
This comment has been minimized.
mxork
commented
Mar 17, 2016
|
+1 for not contaminating stdout during a 'cargo run' |
This comment has been minimized.
This comment has been minimized.
kevincox
commented
Mar 20, 2016
|
Why does it seem strange to print diagnostic information to stderr? I generally think of stderr as the default place to print things, only using stdout for things that are actually output. This way shell piping works as expected. Seeing as cargo output isn't supposed to be machine readable I would suggest putting all messages to stderr. This is especially useful when using |
This comment has been minimized.
This comment has been minimized.
|
This seems like a reasonable feature to me to add! Especially if it helps out running small scripts here and there so much. |
alexcrichton
added
the
E-easy
label
Mar 21, 2016
alexcrichton
referenced this issue
May 8, 2016
Closed
Output of cargo metadata may not be machine-readable if the registry needs to be updated #2661
This comment has been minimized.
This comment has been minimized.
|
I've tried implementing this. Looks like the only code change is in this line. There are several calls to However when status messages go to stderr, 200+ of tests fail :( Should I just change |
This comment has been minimized.
This comment has been minimized.
|
Yeah I had a feeling that this'd need a lot of updates to tests... We'd probably just want to update them to use |
This comment has been minimized.
This comment has been minimized.
|
Will try to send a PR later today :) |
bors
closed this
in
#2693
May 20, 2016
This comment has been minimized.
This comment has been minimized.
w0rp
commented
Oct 26, 2017
|
Changing the output stream to stderr broke integration with ALE. |
This comment has been minimized.
This comment has been minimized.
w0rp
commented
Oct 26, 2017
•
|
Luckily, ALE can handle stderr, stdout, or both streams at the same time. ALE will have to accept both streams, because it could be either one, depending on the version of cargo. |
This comment has been minimized.
This comment has been minimized.
|
Hm, the changed happened a rather long time ago, I would be surprised to find a lot of cargos which use stdout now.... |
This comment has been minimized.
This comment has been minimized.
w0rp
commented
Oct 26, 2017
|
Yeah, I noticed that. Strangely, I hadn't received any complaints until quite recently. That makes me wonder which versions of cargo people are actually using. |
This comment has been minimized.
This comment has been minimized.
|
Hm, maybe then complaints are about some unrelated change to Cargo/Rustc output? It would be prudent to ask about the version of Cargo indeed! |
huonw commentedApr 1, 2015
Currently output generated by
cargoitself goes to stdout, whilerustcs goes to stderr. This is pretty annoying for a commandcargo run, where the user controls stdout and may not appreciate the contamination fromcargo, e.g.cargo run --bin foo > some_file.txtwill include theCompiling ...andRunning ...lines.Alteratively, I suppose we could support
cargo run --output some_file.txt --bin foowhich will do the redirect internally.