[flutter_tools] Add a timeout to another showBuildSettings command (#39579)
diff --git a/packages/flutter_tools/lib/src/ios/xcodeproj.dart b/packages/flutter_tools/lib/src/ios/xcodeproj.dart
index 5acc1c1..8c54c61 100644
--- a/packages/flutter_tools/lib/src/ios/xcodeproj.dart
+++ b/packages/flutter_tools/lib/src/ios/xcodeproj.dart
@@ -20,6 +20,7 @@
import '../cache.dart';
import '../globals.dart';
import '../project.dart';
+import '../reporting/reporting.dart';
final RegExp _settingExpr = RegExp(r'(\w+)\s*=\s*(.*)$');
final RegExp _varExpr = RegExp(r'\$\(([^)]*)\)');
@@ -278,18 +279,20 @@
final Status status = Status.withSpinner(
timeout: timeoutConfiguration.fastOperation,
);
+ final List<String> showBuildSettingsCommand = <String>[
+ _executable,
+ '-project',
+ fs.path.absolute(projectPath),
+ '-target',
+ target,
+ '-showBuildSettings',
+ ];
try {
// showBuildSettings is reported to ocassionally timeout. Here, we give it
// a lot of wiggle room (locally on Flutter Gallery, this takes ~1s).
// When there is a timeout, we retry once.
- final RunResult result = await runCheckedAsync(<String>[
- _executable,
- '-project',
- fs.path.absolute(projectPath),
- '-target',
- target,
- '-showBuildSettings',
- ],
+ final RunResult result = await runCheckedAsync(
+ showBuildSettingsCommand,
workingDirectory: projectPath,
timeout: timeout,
timeoutRetries: 1,
@@ -297,6 +300,11 @@
final String out = result.stdout.trim();
return parseXcodeBuildSettings(out);
} catch(error) {
+ if (error is ProcessException && error.toString().contains('timed out')) {
+ BuildEvent('xcode-show-build-settings-timeout',
+ command: showBuildSettingsCommand.join(' '),
+ ).send();
+ }
printTrace('Unexpected failure to get the build settings: $error.');
return const <String, String>{};
} finally {