Run gsutil with full python3 and full path. (#132805)

This is to prevent failures when the gsutil.py is not executable.
This commit is contained in:
godofredoc 2023-08-17 16:09:44 -07:00 committed by GitHub
parent aa1bacb35a
commit a70a852c66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 11 deletions

View File

@ -833,16 +833,8 @@ class ArchivePublisher {
print('gsutil.py -- $args');
return '';
}
if (platform.isWindows) {
return _processRunner.runProcess(
<String>['python3', path.join(platform.environment['DEPOT_TOOLS']!, 'gsutil.py'), '--', ...args],
workingDirectory: workingDirectory,
failOk: failOk,
);
}
return _processRunner.runProcess(
<String>['gsutil.py', '--', ...args],
<String>['python3', path.join(platform.environment['DEPOT_TOOLS']!, 'gsutil.py'), '--', ...args],
workingDirectory: workingDirectory,
failOk: failOk,
);

View File

@ -38,7 +38,7 @@ void main() {
final FakePlatform platform = FakePlatform(
operatingSystem: platformName,
environment: <String, String>{
'DEPOT_TOOLS': path.join('D:', 'depot_tools'),
'DEPOT_TOOLS': platformName == Platform.windows ? path.join('D:', 'depot_tools'): '/depot_tools',
},
);
group('ProcessRunner for $platform', () {
@ -378,7 +378,7 @@ void main() {
late Directory tempDir;
final String gsutilCall = platform.isWindows
? 'python3 ${path.join("D:", "depot_tools", "gsutil.py")}'
: 'gsutil.py';
: 'python3 ${path.join("/", "depot_tools", "gsutil.py")}';
final String releasesName = 'releases_$platformName.json';
final String archiveName = platform.isLinux ? 'archive.tar.xz' : 'archive.zip';
final String archiveMime = platform.isLinux ? 'application/x-gtar' : 'application/zip';