-
Notifications
You must be signed in to change notification settings - Fork 13.3k
bootstrap: Don't use panics to report user errors #107019
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
Comments
Can I take this ? |
@GentBinaku go for it! |
I think it's easy to find things that are clear user errors and to print that to the user. But in general, even a failing |
@est31 in that case, I would expect cargo-miri to have a reasonable message that explains what's going on. but honestly at that point even if miri anticipated the error the whole thing becomes quite murky: is it a "user error" if bootstrap and miri both work fine individually but not in combination? Is it a "user error" if someone runs FWIW rustc prints the ICE message when you rebase over master and try to reuse the incremental cache and that was very helpful for finding #76720. |
Yeah it is a really hard question to answer. The problem is rooted in bootstrap's nature of being a system integration tool, with some of the components of the system even provided by the user (or optionally provided, say the stage 0 compiler). The components called by bootstrap have different concepts of "user" as bootstrap (for them, bootstrap is another user), they receive different input data (it's been preprocessed by bootstrap), etc. In rustc on the other hand, everyone is on the same page about who the user is, what user input is, etc.
Interesting, I didn't know about that. rustc's ICE messages might not be 100% accurate but they have a very low false positive rate which is very helpful. |
Yup, and this was one case where it was a false positive: the bug was in bootstrap because it was forcing two different compilers to reuse the same incremental cache. In general I would rather not tell people to ignore errors; the worst that happens is we get multiple reports of the same bug, whereas if we tell people to ignore errors we don't know about real bugs people are running into. |
Copying my comment from #107417: As a general rule:
|
Currently, bootstrap uses
assert!
interchangeably between "we expect this command to always succeed" and "you, the user, did something wrong and need to fix it". Seerust/src/bootstrap/test.rs
Line 553 in d28ef9d
rust/src/bootstrap/test.rs
Line 1611 in d28ef9d
The background motivation is that people are used to seeing the latter panics, and so don't report bugs when they see the former. This makes it hard to fix bugs because we don't know things are broken.
The text was updated successfully, but these errors were encountered: