Unverified Commit a70a852c authored by godofredoc's avatar godofredoc Committed by GitHub

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

This is to prevent failures when the gsutil.py is not executable.
parent aa1bacb3
...@@ -833,7 +833,6 @@ class ArchivePublisher { ...@@ -833,7 +833,6 @@ class ArchivePublisher {
print('gsutil.py -- $args'); print('gsutil.py -- $args');
return ''; return '';
} }
if (platform.isWindows) {
return _processRunner.runProcess( return _processRunner.runProcess(
<String>['python3', path.join(platform.environment['DEPOT_TOOLS']!, 'gsutil.py'), '--', ...args], <String>['python3', path.join(platform.environment['DEPOT_TOOLS']!, 'gsutil.py'), '--', ...args],
workingDirectory: workingDirectory, workingDirectory: workingDirectory,
...@@ -841,13 +840,6 @@ class ArchivePublisher { ...@@ -841,13 +840,6 @@ class ArchivePublisher {
); );
} }
return _processRunner.runProcess(
<String>['gsutil.py', '--', ...args],
workingDirectory: workingDirectory,
failOk: failOk,
);
}
/// Determine if a file exists at a given [cloudPath]. /// Determine if a file exists at a given [cloudPath].
Future<bool> _cloudPathExists(String cloudPath) async { Future<bool> _cloudPathExists(String cloudPath) async {
try { try {
......
...@@ -38,7 +38,7 @@ void main() { ...@@ -38,7 +38,7 @@ void main() {
final FakePlatform platform = FakePlatform( final FakePlatform platform = FakePlatform(
operatingSystem: platformName, operatingSystem: platformName,
environment: <String, String>{ 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', () { group('ProcessRunner for $platform', () {
...@@ -378,7 +378,7 @@ void main() { ...@@ -378,7 +378,7 @@ void main() {
late Directory tempDir; late Directory tempDir;
final String gsutilCall = platform.isWindows final String gsutilCall = platform.isWindows
? 'python3 ${path.join("D:", "depot_tools", "gsutil.py")}' ? '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 releasesName = 'releases_$platformName.json';
final String archiveName = platform.isLinux ? 'archive.tar.xz' : 'archive.zip'; final String archiveName = platform.isLinux ? 'archive.tar.xz' : 'archive.zip';
final String archiveMime = platform.isLinux ? 'application/x-gtar' : 'application/zip'; final String archiveMime = platform.isLinux ? 'application/x-gtar' : 'application/zip';
......
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