Closed jyn514 closed 4 years ago
I'm not sure this is something we want to do: while for simple commands this is fine, when a build fails all the output would be duplicated, with a huge error message. I'd prefer for downstream users to avoid hiding the output when the command might fail.
What if we only printed the error if log_output
is set to false? That wouldn't require any upstream changes and would also avoid duplicate output.
Do you happen to remember which log_output(false)
made debugging worse for you? It's supposed to be used only when the output is not relevant at all.
I think it might have been https://github.com/rust-lang/docs.rs/blob/master/src/docbuilder/rustwide_builder.rs#L118 and rustup was complaining about a toolchain that wasn't installed? Don't quote me on that.
I still this Rustwide is the right place to fix this so upstream doesn't have to guess which commands could ever fail.
This solution is not consistent though. The output is collected only when run_capture
is called, so the error message is not shown most of the times. If we fix that by always storing the output then we get into problems when a program outputs a bunch of stuff and we waste memory.
I don't think it's worth implementing it into rustwide.
this would have made debugging docs.rs much easier