diff --git a/tool/lib/commands/update_flutter_sdk.dart b/tool/lib/commands/update_flutter_sdk.dart index ab118763126..73a95f5070c 100644 --- a/tool/lib/commands/update_flutter_sdk.dart +++ b/tool/lib/commands/update_flutter_sdk.dart @@ -86,10 +86,23 @@ class UpdateFlutterSdkCommand extends Command { } // Next, update (or clone) the tool/flutter-sdk copy. + + // On Windows LCUI trybots, some of the flutter repo paths cause + // "Filename too long" errors. Filenames such as: + // engine/src/flutter/testing/ios_scenario_app/ios/Scenarios/ + // ScenariosUITests/ + // golden_platform_view_clippath_with_transform_multiple_clips_impeller_iPhone SE (3rd generation)_26.2_simulator.png'. + final gitLongFilesCommand = CliCommand.git([ + 'config', + 'core.longpaths', + 'true', + ]); + if (Directory(toolSdkPath).existsSync()) { log.stdout('Updating Flutter at $toolSdkPath'); await processManager.runAll( commands: [ + gitLongFilesCommand, CliCommand.git(['fetch']), CliCommand.git(['checkout', flutterVersion, '-f']), CliCommand.flutter(['--version']), @@ -101,6 +114,7 @@ class UpdateFlutterSdkCommand extends Command { await processManager.runProcess( CliCommand.git([ 'clone', + '--no-checkout', 'https://github.com/flutter/flutter', flutterSdkDirName, ]), @@ -108,6 +122,7 @@ class UpdateFlutterSdkCommand extends Command { ); await processManager.runAll( commands: [ + gitLongFilesCommand, CliCommand.git(['checkout', flutterVersion, '-f']), CliCommand.flutter(['--version']), ], diff --git a/tool/lib/utils.dart b/tool/lib/utils.dart index bc8d85a1027..97e3b593e2b 100644 --- a/tool/lib/utils.dart +++ b/tool/lib/utils.dart @@ -163,6 +163,7 @@ extension DevToolsProcessManagerExtension on ProcessManager { ); } + /// Runs [commands] in serial, from [workingDirectory]. Future runAll({ required List commands, String? workingDirectory,