Closed nicopap closed 11 months ago
I did use gir
a bit more and this is a regression in certain cases.
It seems stderr actually is printed and is visible in the terminal when running cargo test
. With this change, we lose the nice color formatting of the error.
I'm not sure why in the first place I didn't see the compilation error output. I'm fairly certain it didn't show up. Maybe it depends on what calls the compile
function? I don't know.
Since this is a regression I'm going to put the pull request in draft mode.
I now know why the tests previously failed without showing any errors. I'm closing this in favor of a fix for the problem in question.
Currently, when a
sys
compilation fails, the only context given is the command used to compile the code.This is less than helpful. This PR adds all the compilation commands' output to the error message.
It also prints the message.
unwrap
doesn't format properly error messages, so we useprintln!
as well. This results in the output being duplicated.I consider the duplicate output to be acceptable, it's already far better than the current output, the fact that code is generated makes testing and developing a lot harder and we shouldn't let perfect be enemy of the better.
Here is a sample of the difference this commit makes:
BEFORE
AFTER