-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Show Xcode compilation errors at end of build, suppress stdout and stderr from Xcode #113302
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
Conversation
| echoError(errorOutput.toString()); | ||
| } | ||
| if (!allowFail && result.exitCode != 0) { | ||
| stderr.write('${result.stderr}\n'); |
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 redundant, echoError writes to stderr right above this.
| } | ||
| if (buildResult != null && buildResult.exitCode != 0) { | ||
| globals.printStatus('Failed to build iOS app'); | ||
| if (buildResult.stderr.isNotEmpty) { |
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.
Stop printing the Xcode output when we have more specific error to display, to reduce noise
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.
So the assumption is that the actual error was already echo'd by xcode_backend?
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.
Yes, that because the build failed there will be at least one error message from Xcode that will be parsed and already shown. That includes any failure from assemble, including a dart compilation issue.
| ↳ | ||
| blah | ||
| === CLEAN TARGET url_launcher OF PROJECT Pods WITH CONFIGURATION Release === |
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.
Removed some of the irrelevant parts of the output of these tests to make it more concise.
| if (resultStderr.isNotEmpty) { | ||
| final StringBuffer errorOutput = StringBuffer(); | ||
| if (result.exitCode != 0) { | ||
| // "error:" prefix makes this show up as an Xcode compilation error. |
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.
nifty
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.
Nifty and totally undocumented, I don't even remember how I learned about this.
| void _parseIssueInStdout(XcodeBuildExecution xcodeBuildExecution, Logger logger, XcodeBuildResult result) { | ||
| final String? stderr = result.stderr; | ||
| if (stderr != null && stderr.isNotEmpty) { | ||
| logger.printStatus('Error output from Xcode build:\n↳'); |
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.
should this be logger.printError?
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 just moved, and it was printStatus before. Not sure why and I don't really want to change it now... Hopefully we almost never drop back to this fallback.
christopherfujino
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
…t and stderr from Xcode (flutter/flutter#113302)
…t and stderr from Xcode (flutter/flutter#113302)
…t and stderr from Xcode (flutter/flutter#113302)
…t and stderr from Xcode (flutter/flutter#113302)
assemblestderr witherror:to make them show up as compilation errors in the Xcode UI and the parsed XCResults. Example dart compilation error showing in Xcode:Treat
assemblebuild system exceptions as fatal, but only show stack traces in verbose mode. As far as I can tell noExceptionMeasurementwas ever fatal, so only showing stack traces in verbose mode shouldn't suppress previously displayed stack traces, since there were none. See Don't log stack traces to console on build failures #44966 and [flutter_tools] Allow the tool to suppress compilation errors. #58539 for some of the history of that TODO.Stop showing the final x stderr and stdout lines of the Xcode build, unless the xcresult can't be parsed. This should reduce the noise in the build failure.
Stop showing the "missing development team" message when there is a more specific error to show.
This should make triaging issues easier, since the build error will be visible and obvious without
--verbose.Iteration on #22536
Fixes #32755
Fixes #113203
Fixes #100721
Fixes #98298
Compilation failure on iOS
Before
After
Other assemble failure on iOS
A file system exception
Before
No indication there is a file system issue.

After
Compilation failure on Android
Before
After
There's one additional line:
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.