-
Notifications
You must be signed in to change notification settings - Fork 29.8k
[flutter_tools] Allow the tool to suppress compilation errors. #58539
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
[flutter_tools] Allow the tool to suppress compilation errors. #58539
Conversation
|
This also removes some of the extraneous output and newlines to simplify things a bit. For example, a compile error on startup (android) now looks like: In a separate PR, we could chop off the footer (seems fairly stable) when the error is |
| ); | ||
| if (output == null || output.errorCount != 0) { | ||
| throw Exception('Errors during snapshot creation: $output'); | ||
| throw Exception(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added nothing
| ? measurement.stackTrace | ||
| : null, | ||
| ); | ||
| if (measurement.fatal || globals.logger.isVerbose) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only show for verbose errors, actual bugs will get logged to stderr
| // Invalid state, see commented issue below for more information. | ||
| // NB: both the completeError and _badState flags are required to avoid | ||
| // filling the console with exceptions. | ||
| if (boundaryKey == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was fixed several months ago by @aam
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <FlutterDevice>[ | ||
| mockFlutterDevice, | ||
| ], | ||
| applicationBinary: globals.fs.file('app.apk'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When there is an applicationBinary then there was no native build step, so we need to show the flutter run errors as normal
|
The xcode output is: Which is a bit better |
| List<Uri> invalidatedFiles, { | ||
| String outputPath, | ||
| PackageConfig packageConfig, | ||
| bool suppressErrors = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment for when you would want to suppress errors? Doesn't sound like something you would generally want to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this PR is the crumb trail for the signature as to why you would want to suppress errors (so they aren't displayed twice in certain scenarios).
jmagman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
We should consider having end-to-end tests that verify the entire text of common scenarios like error messages, startup, etc, to make sure we don't accidentally regress the actual output. |
Description
suppress compilation errors on startup to make the most egregious parts of #58337 better
Specifically: