-
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
Print & color build script warnings, even when build script panics #3672
Comments
Seems reasonable to me! Do you have a preference either before or after the standard error output? |
I feel like putting the warning before the panic dump is a good idea, because conceptually the warnings were "emitted" by the build script before the build script "emitted" the panic. I'm open to other options though. |
Seems reasonable to me. Unfortunately I probably won't have time to implement this in the near future, but I believe the relevant loop is this one. We likely just need to listen for more messages coming on |
I did some investigation on this and here's what I've found: The warnings get printed in emit_warnings() from As to why that happens: The output with warnings is still contained inside the error returned by At this point I would like to get the team's input on what would be the cleanest way to push warnings into |
Yea, that's a little awkward. I think what I would do is inside the Also, an unrelated thing: it might be nice for build script warnings to be prefixed with the package name/version (the same way it is prefixed with |
@ehuss I've done the suggested implementation
Maybe worth creating a separate issue for this? |
Sure, posted #8018. |
…anic, r=ehuss Print colored warnings when build script panics Fixes #3672
Currently, when the build script panics, the stdout of the build script is written out to show what happened. However, this means that any warnings emitted during the build script (using cargo:warning= from #2630) won't be printed nicely like they are when the build script succeeds.
It would be nice if these warnings could be printed prettily even when the build script fails to execute due to a panic.
The text was updated successfully, but these errors were encountered: