Skip to content

Commit a469731

Browse files
authored
Prepare for long filenames in Flutter repo (#9888)
1 parent 01fe32d commit a469731

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

tool/lib/commands/update_flutter_sdk.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,23 @@ class UpdateFlutterSdkCommand extends Command {
8686
}
8787

8888
// Next, update (or clone) the tool/flutter-sdk copy.
89+
90+
// On Windows LCUI trybots, some of the flutter repo paths cause
91+
// "Filename too long" errors. Filenames such as:
92+
// engine/src/flutter/testing/ios_scenario_app/ios/Scenarios/
93+
// ScenariosUITests/
94+
// golden_platform_view_clippath_with_transform_multiple_clips_impeller_iPhone SE (3rd generation)_26.2_simulator.png'.
95+
final gitLongFilesCommand = CliCommand.git([
96+
'config',
97+
'core.longpaths',
98+
'true',
99+
]);
100+
89101
if (Directory(toolSdkPath).existsSync()) {
90102
log.stdout('Updating Flutter at $toolSdkPath');
91103
await processManager.runAll(
92104
commands: [
105+
gitLongFilesCommand,
93106
CliCommand.git(['fetch']),
94107
CliCommand.git(['checkout', flutterVersion, '-f']),
95108
CliCommand.flutter(['--version']),
@@ -101,13 +114,15 @@ class UpdateFlutterSdkCommand extends Command {
101114
await processManager.runProcess(
102115
CliCommand.git([
103116
'clone',
117+
'--no-checkout',
104118
'https://github.com/flutter/flutter',
105119
flutterSdkDirName,
106120
]),
107121
workingDirectory: repo.toolDirectoryPath,
108122
);
109123
await processManager.runAll(
110124
commands: [
125+
gitLongFilesCommand,
111126
CliCommand.git(['checkout', flutterVersion, '-f']),
112127
CliCommand.flutter(['--version']),
113128
],

tool/lib/utils.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ extension DevToolsProcessManagerExtension on ProcessManager {
163163
);
164164
}
165165

166+
/// Runs [commands] in serial, from [workingDirectory].
166167
Future<void> runAll({
167168
required List<CliCommand> commands,
168169
String? workingDirectory,

0 commit comments

Comments
 (0)