Skip to content

Conversation

@hellohuanlin
Copy link
Contributor

@hellohuanlin hellohuanlin commented Aug 15, 2025

Reverts #173569

Sorry I have to revert this one as it didn't work.

Why didn't work

From the comment, it looks like echoError is only used for verbose mode, and streamOutput is used for non-verbose mode (I am still looking into how this is setup)

// When in verbose mode, `echoError` above will show the logs. So only

How to fix

Possible Fix 1

I tested this works, by changing this line:

https://github.com/flutter/flutter/blob/master/packages/flutter_tools/bin/xcode_backend.dart#L159

into this:

if (!verbose && exitCode == 0 && !skipErrorLog)

Possible fix 2:

Surprisingly this also works:

if (!verbose && exitCode == 0) {
  streamOutput(errorOutput.string().replaceAll('error', '');
}

Although we made sure errorOutput doesn't start with error:, there's an error: in the middle of the string.

Possibly because of this code in mac.dart:

if (!globals.logger.isVerbose) {
if (line.contains('error:')) {
globals.printError(line);

Why we missed it?

I tested my initial code code and assumed updated code would work, because I incorrectly thought echoError was the one triggered the output in non-verbose mode. I should have verified it.

@hellohuanlin hellohuanlin requested a review from a team as a code owner August 15, 2025 20:59
@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. team-ios Owned by iOS platform team labels Aug 15, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request reverts a previous change that attempted to suppress certain error logs. The revert removes the skipErrorLog parameter and associated logic from runSync in xcode_backend.dart, and simplifies the related tests.

My review has identified a critical issue where an undefined variable is used, which will cause a runtime error. I've also pointed out missing documentation that violates the project's style guide. Please address these points.

Comment on lines +105 to 107
/// Run given command in a synchronous subprocess.
///
/// Will throw [Exception] if the exit code is not 0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The documentation for the verbose and allowFail parameters is missing. According to the Flutter Style Guide, all public members should have documentation.1

Please add documentation for these parameters to explain their purpose.

  /// Run given command in a synchronous subprocess.
  ///
  /// If [verbose] is true, the command being run and its stdout will be printed.
  ///
  /// If [allowFail] is true, an exception will not be thrown even if the process returns a
  /// non-zero exit code. Also, `error:` will not be prefixed to the output to prevent Xcode
  /// complication failures.
  ///
  /// Will throw [Exception] if the exit code is not 0.

Style Guide References

Footnotes

  1. All public members should have documentation. (link)

@hellohuanlin
Copy link
Contributor Author

hellohuanlin commented Aug 15, 2025

From the comment, it looks like echoError is only used for verbose mode, and streamOutput is used for non-verbose mode (I am still looking into how this is setup)

I think I get it now.

For echoError: mac.dart calls _DefaultProcessUtils::run, which does _logger.printTrace(runResult). So in echoError is only print out in verbose mode!

For streamOutput: mac.dart::listenToScriptOutputLine loops through lines like this:

if !verbose {
  only print lines containing "error:" and "warning:"
} else {
  print line
}

This is so confusing...

I think I will go with the fix 1 in the PR description, since fix 2's call path is a bit convoluted

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean revert LGTM.
@hellohuanlin can you file a new issue or open the old one and document your findings and suggested fixes?

@hellohuanlin hellohuanlin added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 15, 2025
@hellohuanlin
Copy link
Contributor Author

@hellohuanlin can you file a new issue or open the old one and document your findings and suggested fixes?

re-opened the old issue.

@auto-submit auto-submit bot added this pull request to the merge queue Aug 15, 2025
Merged via the queue into master with commit eeb3a40 Aug 16, 2025
150 of 151 checks passed
@auto-submit auto-submit bot deleted the revert-173569-xcode_plist_key_not_found_do_not_log_at_all branch August 16, 2025 00:16
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 16, 2025
flutter/flutter@52af7a5...0a2906b

2025-08-16 [email protected] Improve `SweepGradient` angle and `TileMode` documentation (flutter/flutter#172406)
2025-08-16 [email protected] Roll Skia from 1e148cada9d4 to 16dbd908dcab (1 revision) (flutter/flutter#173901)
2025-08-16 [email protected] Roll Skia from 91ad1f21ca61 to 1e148cada9d4 (3 revisions) (flutter/flutter#173890)
2025-08-16 [email protected] Roll Dart SDK from 9277d6303da5 to 67ca79475db6 (1 revision) (flutter/flutter#173886)
2025-08-15 [email protected] Blocks exynos9820 chip from vulkan (flutter/flutter#173807)
2025-08-15 [email protected] Revert "[ios][tools]do not log "bonjour not found" at all (unless verbose)" (flutter/flutter#173879)
2025-08-15 [email protected] Roll `package:analyzer` forward to `8.1.1` (flutter/flutter#173867)
2025-08-15 [email protected] Roll Skia from 2f66be8a593a to 91ad1f21ca61 (3 revisions) (flutter/flutter#173877)
2025-08-15 [email protected] [a11y] : set isFocused will update isFocusable to true (flutter/flutter#170935)
2025-08-15 [email protected] Reland predictive back route transitions by default (flutter/flutter#173860)
2025-08-15 [email protected] Roll Fuchsia Linux SDK from zWRpLglb48zC1vZLv... to H1kVA85LyQsK8EDp2... (flutter/flutter#173874)
2025-08-15 [email protected] Add onHover callback support for TableRowInkWell (flutter/flutter#173373)
2025-08-15 [email protected] Roll Skia from 5654ac32ede0 to 2f66be8a593a (6 revisions) (flutter/flutter#173866)
2025-08-15 [email protected] Roll Dart SDK from cc008dc8e7aa to 9277d6303da5 (2 revisions) (flutter/flutter#173864)
2025-08-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Implements the Android native stretch effect as a fragment shader (Impeller-only). (#169293)" (flutter/flutter#173865)
2025-08-15 [email protected] Re-add `Linux_android_emu *` tests that had KVM issues, now resolved (flutter/flutter#173812)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
…bose)" (flutter#173879)

Reverts flutter#173569

Sorry I have to revert this one as it didn't work. 

# Why didn't work

From the comment, it looks like `echoError` is only used for verbose
mode, and `streamOutput` is used for non-verbose mode (I am still
looking into how this is setup)


https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/bin/xcode_backend.dart#L151

# How to fix

## Possible Fix 1

I tested this works, by changing this line: 


https://github.com/flutter/flutter/blob/master/packages/flutter_tools/bin/xcode_backend.dart#L159

into this: 

```
if (!verbose && exitCode == 0 && !skipErrorLog)
```

## Possible fix 2: 

Surprisingly this also works: 
```
if (!verbose && exitCode == 0) {
  streamOutput(errorOutput.string().replaceAll('error', '');
}
```

Although we made sure `errorOutput` doesn't start with `error:`, there's
an `error:` in the middle of the string.

Possibly because of this code in `mac.dart`: 

https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/lib/src/ios/mac.dart#L431-L433

# Why we missed it? 

I tested my initial code code and assumed updated code would work,
because I incorrectly thought `echoError` was the one triggered the
output in non-verbose mode. I should have verified it.
WillBLogical pushed a commit to WillBLogical/packages that referenced this pull request Aug 20, 2025
…r#9836)

flutter/flutter@52af7a5...0a2906b

2025-08-16 [email protected] Improve `SweepGradient` angle and `TileMode` documentation (flutter/flutter#172406)
2025-08-16 [email protected] Roll Skia from 1e148cada9d4 to 16dbd908dcab (1 revision) (flutter/flutter#173901)
2025-08-16 [email protected] Roll Skia from 91ad1f21ca61 to 1e148cada9d4 (3 revisions) (flutter/flutter#173890)
2025-08-16 [email protected] Roll Dart SDK from 9277d6303da5 to 67ca79475db6 (1 revision) (flutter/flutter#173886)
2025-08-15 [email protected] Blocks exynos9820 chip from vulkan (flutter/flutter#173807)
2025-08-15 [email protected] Revert "[ios][tools]do not log "bonjour not found" at all (unless verbose)" (flutter/flutter#173879)
2025-08-15 [email protected] Roll `package:analyzer` forward to `8.1.1` (flutter/flutter#173867)
2025-08-15 [email protected] Roll Skia from 2f66be8a593a to 91ad1f21ca61 (3 revisions) (flutter/flutter#173877)
2025-08-15 [email protected] [a11y] : set isFocused will update isFocusable to true (flutter/flutter#170935)
2025-08-15 [email protected] Reland predictive back route transitions by default (flutter/flutter#173860)
2025-08-15 [email protected] Roll Fuchsia Linux SDK from zWRpLglb48zC1vZLv... to H1kVA85LyQsK8EDp2... (flutter/flutter#173874)
2025-08-15 [email protected] Add onHover callback support for TableRowInkWell (flutter/flutter#173373)
2025-08-15 [email protected] Roll Skia from 5654ac32ede0 to 2f66be8a593a (6 revisions) (flutter/flutter#173866)
2025-08-15 [email protected] Roll Dart SDK from cc008dc8e7aa to 9277d6303da5 (2 revisions) (flutter/flutter#173864)
2025-08-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Implements the Android native stretch effect as a fragment shader (Impeller-only). (#169293)" (flutter/flutter#173865)
2025-08-15 [email protected] Re-add `Linux_android_emu *` tests that had KVM issues, now resolved (flutter/flutter#173812)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
SydneyBao pushed a commit to SydneyBao/flutter that referenced this pull request Aug 22, 2025
…bose)" (flutter#173879)

Reverts flutter#173569

Sorry I have to revert this one as it didn't work. 

# Why didn't work

From the comment, it looks like `echoError` is only used for verbose
mode, and `streamOutput` is used for non-verbose mode (I am still
looking into how this is setup)


https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/bin/xcode_backend.dart#L151

# How to fix

## Possible Fix 1

I tested this works, by changing this line: 


https://github.com/flutter/flutter/blob/master/packages/flutter_tools/bin/xcode_backend.dart#L159

into this: 

```
if (!verbose && exitCode == 0 && !skipErrorLog)
```

## Possible fix 2: 

Surprisingly this also works: 
```
if (!verbose && exitCode == 0) {
  streamOutput(errorOutput.string().replaceAll('error', '');
}
```

Although we made sure `errorOutput` doesn't start with `error:`, there's
an `error:` in the middle of the string.

Possibly because of this code in `mac.dart`: 

https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/lib/src/ios/mac.dart#L431-L433

# Why we missed it? 

I tested my initial code code and assumed updated code would work,
because I incorrectly thought `echoError` was the one triggered the
output in non-verbose mode. I should have verified it.
SydneyBao pushed a commit to SydneyBao/flutter that referenced this pull request Aug 22, 2025
…bose)" (flutter#173879)

Reverts flutter#173569

Sorry I have to revert this one as it didn't work. 

# Why didn't work

From the comment, it looks like `echoError` is only used for verbose
mode, and `streamOutput` is used for non-verbose mode (I am still
looking into how this is setup)


https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/bin/xcode_backend.dart#L151

# How to fix

## Possible Fix 1

I tested this works, by changing this line: 


https://github.com/flutter/flutter/blob/master/packages/flutter_tools/bin/xcode_backend.dart#L159

into this: 

```
if (!verbose && exitCode == 0 && !skipErrorLog)
```

## Possible fix 2: 

Surprisingly this also works: 
```
if (!verbose && exitCode == 0) {
  streamOutput(errorOutput.string().replaceAll('error', '');
}
```

Although we made sure `errorOutput` doesn't start with `error:`, there's
an `error:` in the middle of the string.

Possibly because of this code in `mac.dart`: 

https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/lib/src/ios/mac.dart#L431-L433

# Why we missed it? 

I tested my initial code code and assumed updated code would work,
because I incorrectly thought `echoError` was the one triggered the
output in non-verbose mode. I should have verified it.
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…bose)" (flutter#173879)

Reverts flutter#173569

Sorry I have to revert this one as it didn't work. 

# Why didn't work

From the comment, it looks like `echoError` is only used for verbose
mode, and `streamOutput` is used for non-verbose mode (I am still
looking into how this is setup)


https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/bin/xcode_backend.dart#L151

# How to fix

## Possible Fix 1

I tested this works, by changing this line: 


https://github.com/flutter/flutter/blob/master/packages/flutter_tools/bin/xcode_backend.dart#L159

into this: 

```
if (!verbose && exitCode == 0 && !skipErrorLog)
```

## Possible fix 2: 

Surprisingly this also works: 
```
if (!verbose && exitCode == 0) {
  streamOutput(errorOutput.string().replaceAll('error', '');
}
```

Although we made sure `errorOutput` doesn't start with `error:`, there's
an `error:` in the middle of the string.

Possibly because of this code in `mac.dart`: 

https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/lib/src/ios/mac.dart#L431-L433

# Why we missed it? 

I tested my initial code code and assumed updated code would work,
because I incorrectly thought `echoError` was the one triggered the
output in non-verbose mode. I should have verified it.
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…bose)" (flutter#173879)

Reverts flutter#173569

Sorry I have to revert this one as it didn't work. 

# Why didn't work

From the comment, it looks like `echoError` is only used for verbose
mode, and `streamOutput` is used for non-verbose mode (I am still
looking into how this is setup)


https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/bin/xcode_backend.dart#L151

# How to fix

## Possible Fix 1

I tested this works, by changing this line: 


https://github.com/flutter/flutter/blob/master/packages/flutter_tools/bin/xcode_backend.dart#L159

into this: 

```
if (!verbose && exitCode == 0 && !skipErrorLog)
```

## Possible fix 2: 

Surprisingly this also works: 
```
if (!verbose && exitCode == 0) {
  streamOutput(errorOutput.string().replaceAll('error', '');
}
```

Although we made sure `errorOutput` doesn't start with `error:`, there's
an `error:` in the middle of the string.

Possibly because of this code in `mac.dart`: 

https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/lib/src/ios/mac.dart#L431-L433

# Why we missed it? 

I tested my initial code code and assumed updated code would work,
because I incorrectly thought `echoError` was the one triggered the
output in non-verbose mode. I should have verified it.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
…bose)" (flutter#173879)

Reverts flutter#173569

Sorry I have to revert this one as it didn't work. 

# Why didn't work

From the comment, it looks like `echoError` is only used for verbose
mode, and `streamOutput` is used for non-verbose mode (I am still
looking into how this is setup)


https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/bin/xcode_backend.dart#L151

# How to fix

## Possible Fix 1

I tested this works, by changing this line: 


https://github.com/flutter/flutter/blob/master/packages/flutter_tools/bin/xcode_backend.dart#L159

into this: 

```
if (!verbose && exitCode == 0 && !skipErrorLog)
```

## Possible fix 2: 

Surprisingly this also works: 
```
if (!verbose && exitCode == 0) {
  streamOutput(errorOutput.string().replaceAll('error', '');
}
```

Although we made sure `errorOutput` doesn't start with `error:`, there's
an `error:` in the middle of the string.

Possibly because of this code in `mac.dart`: 

https://github.com/flutter/flutter/blob/e4f27cd09734db6c6ed94e104ab5333c48dfc544/packages/flutter_tools/lib/src/ios/mac.dart#L431-L433

# Why we missed it? 

I tested my initial code code and assumed updated code would work,
because I incorrectly thought `echoError` was the one triggered the
output in non-verbose mode. I should have verified it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants