-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustc: errors should not display runtime boilerplate logging #1405
Comments
It would be nice if we got rid of that boilerplate for all failures (at least in rustc). We can have main immediately spawn a child task and catch the failure. |
My suggestion above will not actually fix the problem. |
Maybe as a temporary solution we can just add a secret runtime flag to turn these two log messages off |
Maybe we can just turn logging off by default for rustc |
I'm going with a runtime library function to unsupervise on the trapped-and-reported error paths. Unsupervising the root task can mean "inhibit default runtime failure reporting" (though, er, probably should still exit 1?) |
My latest thought was to add core::logging::console_off()/console_on() that rustc could use, and which would be overridden by RUST_LOG. |
Some conversation from IRC:
|
Here's what I'm thinking now:
|
0616cba adds sys::set_exit_status |
After further consideration I don't think having task::unsupervise change the log level of the failure message is right. The thinking is that calling unsupervise indicates that you're expected failure, which makes sense. But it could be that you have a hierarchy of tasks, with only the root of that heirarchy being unsupervised. In that case, you still might expect the children to fail, because you're counting on their parent being unsupervised, in which case we would still see a bunch of log messages. |
6c05214 makes rustc not display any logs unless RUST_LOG is present. I still plan to do a bit more to make sure it's foolproof, e.g. if some bug results in fail without going through the error reporting path rustc shouldn't just terminate silently. |
e36ea8e runs the compilation in a subtask and adds a hook into the error codepath that validates that any failure is properly reported. If the compilation fails without emitting an error diagnostic it displays an ICE. |
Whenever I have a filename typo when running rustc, I always think I'm tripping over some compiler bug before I notice the
error: error opening ...
line at the top. Could rustc catch that the file doesn't exist earlier and cleanly exit instead?The text was updated successfully, but these errors were encountered: