Unverified Commit 088fa244 authored by Dan Field's avatar Dan Field Committed by GitHub

Set the LANG when invoking cocoapods (#45710)

parent afb8f382
...@@ -333,6 +333,9 @@ Future<void> _flutterBuildIpa(String relativePathToApplication) async { ...@@ -333,6 +333,9 @@ Future<void> _flutterBuildIpa(String relativePathToApplication) async {
await runCommand('pod', await runCommand('pod',
<String>['install'], <String>['install'],
workingDirectory: podfile.parent.path, workingDirectory: podfile.parent.path,
environment: <String, String>{
'LANG': 'en_US.UTF-8',
},
); );
} }
await runCommand(flutter, await runCommand(flutter,
......
...@@ -17,7 +17,13 @@ Future<void> main() async { ...@@ -17,7 +17,13 @@ Future<void> main() async {
'${flutterDirectory.path}/examples/flutter_view/ios', '${flutterDirectory.path}/examples/flutter_view/ios',
); );
await inDirectory(iosDirectory, () async { await inDirectory(iosDirectory, () async {
await exec('pod', <String>['install']); await exec(
'pod',
<String>['install'],
environment: <String, String>{
'LANG': 'en_US.UTF-8',
},
);
}); });
final TaskFunction taskFunction = createFlutterViewStartupTest(); final TaskFunction taskFunction = createFlutterViewStartupTest();
......
...@@ -242,7 +242,13 @@ Future<void> main() async { ...@@ -242,7 +242,13 @@ Future<void> main() async {
final File objectiveCAnalyticsOutputFile = File(path.join(tempDir.path, 'analytics-objc.log')); final File objectiveCAnalyticsOutputFile = File(path.join(tempDir.path, 'analytics-objc.log'));
final Directory objectiveCBuildDirectory = Directory(path.join(tempDir.path, 'build-objc')); final Directory objectiveCBuildDirectory = Directory(path.join(tempDir.path, 'build-objc'));
await inDirectory(objectiveCHostApp, () async { await inDirectory(objectiveCHostApp, () async {
await exec('pod', <String>['install']); await exec(
'pod',
<String>['install'],
environment: <String, String>{
'LANG': 'en_US.UTF-8',
},
);
await exec( await exec(
'xcodebuild', 'xcodebuild',
<String>[ <String>[
...@@ -325,7 +331,13 @@ Future<void> main() async { ...@@ -325,7 +331,13 @@ Future<void> main() async {
final Directory swiftBuildDirectory = Directory(path.join(tempDir.path, 'build-swift')); final Directory swiftBuildDirectory = Directory(path.join(tempDir.path, 'build-swift'));
await inDirectory(swiftHostApp, () async { await inDirectory(swiftHostApp, () async {
await exec('pod', <String>['install']); await exec(
'pod',
<String>['install'],
environment: <String, String>{
'LANG': 'en_US.UTF-8',
},
);
await exec( await exec(
'xcodebuild', 'xcodebuild',
<String>[ <String>[
......
...@@ -24,7 +24,13 @@ Future<void> main() async { ...@@ -24,7 +24,13 @@ Future<void> main() async {
'$platformViewDirectoryPath/ios', '$platformViewDirectoryPath/ios',
); );
await inDirectory(iosDirectory, () async { await inDirectory(iosDirectory, () async {
await exec('pod', <String>['install']); await exec(
'pod',
<String>['install'],
environment: <String, String>{
'LANG': 'en_US.UTF-8',
},
);
}); });
final TaskFunction taskFunction = createPlatformViewStartupTest(); final TaskFunction taskFunction = createPlatformViewStartupTest();
......
...@@ -45,6 +45,9 @@ Future<void> main() async { ...@@ -45,6 +45,9 @@ Future<void> main() async {
objcPodspecPath, objcPodspecPath,
'--allow-warnings', '--allow-warnings',
], ],
environment: <String, String>{
'LANG': 'en_US.UTF-8',
},
); );
}); });
...@@ -60,6 +63,9 @@ Future<void> main() async { ...@@ -60,6 +63,9 @@ Future<void> main() async {
'--allow-warnings', '--allow-warnings',
'--use-libraries', '--use-libraries',
], ],
environment: <String, String>{
'LANG': 'en_US.UTF-8',
},
); );
}); });
......
...@@ -77,7 +77,12 @@ class CocoaPods { ...@@ -77,7 +77,12 @@ class CocoaPods {
processUtils.exitsHappy(<String>['which', 'pod']); processUtils.exitsHappy(<String>['which', 'pod']);
Future<String> get cocoaPodsVersionText { Future<String> get cocoaPodsVersionText {
_versionText ??= processUtils.run(<String>['pod', '--version']).then<String>((RunResult result) { _versionText ??= processUtils.run(
<String>['pod', '--version'],
environment: <String, String>{
'LANG': 'en_US.UTF-8',
},
).then<String>((RunResult result) {
return result.exitCode == 0 ? result.stdout.trim() : null; return result.exitCode == 0 ? result.stdout.trim() : null;
}, onError: (dynamic _) => null); }, onError: (dynamic _) => null);
return _versionText; return _versionText;
...@@ -305,6 +310,7 @@ class CocoaPods { ...@@ -305,6 +310,7 @@ class CocoaPods {
// See https://github.com/flutter/flutter/issues/10873. // See https://github.com/flutter/flutter/issues/10873.
// CocoaPods analytics adds a lot of latency. // CocoaPods analytics adds a lot of latency.
'COCOAPODS_DISABLE_STATS': 'true', 'COCOAPODS_DISABLE_STATS': 'true',
'LANG': 'en_US.UTF-8',
}, },
); );
status.stop(); status.stop();
......
...@@ -80,12 +80,12 @@ void main() { ...@@ -80,12 +80,12 @@ void main() {
when(mockProcessManager.run( when(mockProcessManager.run(
<String>['pod', 'install', '--verbose'], <String>['pod', 'install', '--verbose'],
workingDirectory: 'project/ios', workingDirectory: 'project/ios',
environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'}, environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'},
)).thenAnswer((_) async => exitsHappy()); )).thenAnswer((_) async => exitsHappy());
when(mockProcessManager.run( when(mockProcessManager.run(
<String>['pod', 'install', '--verbose'], <String>['pod', 'install', '--verbose'],
workingDirectory: 'project/macos', workingDirectory: 'project/macos',
environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'}, environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'},
)).thenAnswer((_) async => exitsHappy()); )).thenAnswer((_) async => exitsHappy());
}); });
...@@ -368,6 +368,7 @@ void main() { ...@@ -368,6 +368,7 @@ void main() {
environment: <String, String>{ environment: <String, String>{
'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'FLUTTER_FRAMEWORK_DIR': 'engine/path',
'COCOAPODS_DISABLE_STATS': 'true', 'COCOAPODS_DISABLE_STATS': 'true',
'LANG': 'en_US.UTF-8',
}, },
)).thenAnswer((_) async => exitsWithError( )).thenAnswer((_) async => exitsWithError(
''' '''
...@@ -420,7 +421,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -420,7 +421,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
verify(mockProcessManager.run( verify(mockProcessManager.run(
<String>['pod', 'install', '--verbose'], <String>['pod', 'install', '--verbose'],
workingDirectory: 'project/ios', workingDirectory: 'project/ios',
environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'}, environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'},
)); ));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fs, FileSystem: () => fs,
...@@ -447,6 +448,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -447,6 +448,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
environment: <String, String>{ environment: <String, String>{
'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'FLUTTER_FRAMEWORK_DIR': 'engine/path',
'COCOAPODS_DISABLE_STATS': 'true', 'COCOAPODS_DISABLE_STATS': 'true',
'LANG': 'en_US.UTF-8',
}, },
)); ));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -477,6 +479,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -477,6 +479,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
environment: <String, String>{ environment: <String, String>{
'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'FLUTTER_FRAMEWORK_DIR': 'engine/path',
'COCOAPODS_DISABLE_STATS': 'true', 'COCOAPODS_DISABLE_STATS': 'true',
'LANG': 'en_US.UTF-8',
}, },
)); ));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -507,6 +510,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -507,6 +510,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
environment: <String, String>{ environment: <String, String>{
'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'FLUTTER_FRAMEWORK_DIR': 'engine/path',
'COCOAPODS_DISABLE_STATS': 'true', 'COCOAPODS_DISABLE_STATS': 'true',
'LANG': 'en_US.UTF-8',
}, },
)); ));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -539,6 +543,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -539,6 +543,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
environment: <String, String>{ environment: <String, String>{
'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'FLUTTER_FRAMEWORK_DIR': 'engine/path',
'COCOAPODS_DISABLE_STATS': 'true', 'COCOAPODS_DISABLE_STATS': 'true',
'LANG': 'en_US.UTF-8',
}, },
)); ));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -591,6 +596,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -591,6 +596,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
environment: <String, String>{ environment: <String, String>{
'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'FLUTTER_FRAMEWORK_DIR': 'engine/path',
'COCOAPODS_DISABLE_STATS': 'true', 'COCOAPODS_DISABLE_STATS': 'true',
'LANG': 'en_US.UTF-8',
}, },
)).thenAnswer( )).thenAnswer(
(_) async => exitsWithError() (_) async => exitsWithError()
...@@ -621,6 +627,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -621,6 +627,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'FLUTTER_FRAMEWORK_DIR': 'engine/path',
'COCOAPODS_DISABLE_STATS': 'true', 'COCOAPODS_DISABLE_STATS': 'true',
'CP_REPOS_DIR': cocoapodsRepoDir, 'CP_REPOS_DIR': cocoapodsRepoDir,
'LANG': 'en_US.UTF8',
}; };
}); });
...@@ -629,7 +636,6 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -629,7 +636,6 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
fs.file(fs.path.join('project', 'ios', 'Podfile')) fs.file(fs.path.join('project', 'ios', 'Podfile'))
..createSync() ..createSync()
..writeAsStringSync('Existing Podfile'); ..writeAsStringSync('Existing Podfile');
when(mockProcessManager.run( when(mockProcessManager.run(
<String>['pod', 'install', '--verbose'], <String>['pod', 'install', '--verbose'],
workingDirectory: 'project/ios', workingDirectory: 'project/ios',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment