Skip to content

Bring back behavior of -Xfatal-warnings #19713

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

Closed
odersky opened this issue Feb 17, 2024 · 5 comments · Fixed by #19765
Closed

Bring back behavior of -Xfatal-warnings #19713

odersky opened this issue Feb 17, 2024 · 5 comments · Fixed by #19765
Assignees
Milestone

Comments

@odersky
Copy link
Contributor

odersky commented Feb 17, 2024

Compiler version

Since #19245, -Xfatal-warning became completely useless to me. I critically rely on -Xfatal-warnings in connection with -Xprompt to stop the compilation at the point where a warning was given. I need this every other day. But with the new behavior, -Xfatal-warnings has become useless for this task, since it waits until the very end of the compilation run before anything is reported.

I don't see what the point of these disruptive things to the toolchain is. This change causes me to lose lots of time, and probably will cause problems for others relying on the old behavior as well.

We can institute new behavior for -Werror. But please, let's leave -Xfatal-warnings alone!

@odersky odersky added the stat:needs triage Every issue needs to have an "area" and "itype" label label Feb 17, 2024
@dwijnand dwijnand removed the stat:needs triage Every issue needs to have an "area" and "itype" label label Feb 17, 2024
@dwijnand
Copy link
Member

I can understand how it impedes your -Xprompt workflow (interesting to learn!). I definitely don't think we should diverge on behaviour between -Werror and -Xfatal-warnings. Ideally we can make -Xprompt react eagerly on a warning, while under fatal warnings.

@lrytz
Copy link
Member

lrytz commented Feb 19, 2024

Workaround until then is using -Wconf:any:e instead of -Xfatal-warning.

@szymon-rd
Copy link
Contributor

szymon-rd commented Feb 22, 2024

I don't see what the point of these disruptive things to the toolchain is

We decided to go in that direction because we wanted to make the flags enabling all the default errors (upcoming -W) usable with -Xfatal-warnings. Otherwise, the user would need to reiterate over his codebase multiple times, fixing the warnings, instead of seeing them all at once. That would make it a frustrating experience and negatively impact the DX. However, we can add an additional flag that makes the -Xfata-warnings fail early (or add an optional param to -Xfatal-warnings?)

@nicolasstucki
Copy link
Contributor

It might be simpler to make -Werror and -Xfatal-warinings behave differently. -Werror could emmit the single error on warning, while -Xfatal-warinings could make every warning an error.

@lrytz
Copy link
Member

lrytz commented Feb 22, 2024

I think that's what -Wconf:any:e is for. -Xfatal-warinings is the deprecated alias for -Werror.

But a bit of magic to turn -Werror into -Wconf:any:e when -Xprompt is enabled also seems reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants