[infra] Use third_party/gsutil in the status file free workflow.

Change-Id: I13d68092874121acedec305a186867ee88863806
Reviewed-on: https://dart-review.googlesource.com/c/90463
Reviewed-by: Alexander Thomas <athom@google.com>
diff --git a/tools/approve_results.dart b/tools/approve_results.dart
index 718cd37..7c31274 100755
--- a/tools/approve_results.dart
+++ b/tools/approve_results.dart
@@ -281,6 +281,10 @@
     return;
   }
 
+  // Locate gsutil.py.
+  gsutilPy =
+      Platform.script.resolve("../third_party/gsutil/gsutil.py").toFilePath();
+
   // Load the list of bots according to the test matrix.
   final testMatrixPath =
       Platform.script.resolve("bots/test_matrix.json").toFilePath();
diff --git a/tools/bots/results.dart b/tools/bots/results.dart
index ec760c5..549cafe 100644
--- a/tools/bots/results.dart
+++ b/tools/bots/results.dart
@@ -8,8 +8,8 @@
 import 'dart:convert';
 import 'dart:io';
 
-/// gsutil.py binary to use.
-final gsutil = Platform.isWindows ? "gsutil.py.bat" : "gsutil.py";
+/// The path to the gsutil script.
+String gsutilPy;
 
 /// Cloud storage location containing results.
 const testResultsStoragePath = "gs://dart-test-results/builders";
@@ -21,15 +21,16 @@
 /// Runs gsutil with the provided [arguments] and returns the standard output.
 /// Returns null if the requested URL didn't exist.
 Future<String> runGsutil(List<String> arguments) async {
-  final processResult = await Process.run(gsutil, arguments,
-      environment: {"DEPOT_TOOLS_UPDATE": "0"});
+  final processResult = await Process.run(
+      "python", [gsutilPy]..addAll(arguments),
+      runInShell: Platform.isWindows);
   if (processResult.exitCode != 0) {
     if (processResult.exitCode == 1 &&
             processResult.stderr.contains("No URLs matched") ||
         processResult.stderr.contains("One or more URLs matched no objects")) {
       return null;
     }
-    throw new Exception("Failed to run: $gsutil $arguments\n"
+    throw new Exception("Failed to run: python $gsutilPy $arguments\n"
         "exitCode: ${processResult.exitCode}\n"
         "stdout:\n${processResult.stdout}\n"
         "stderr:\n${processResult.stderr}");
diff --git a/tools/test.dart b/tools/test.dart
index 79c9793..ebe3add 100755
--- a/tools/test.dart
+++ b/tools/test.dart
@@ -207,6 +207,10 @@
     return;
   }
 
+  // Locate gsutil.py.
+  gsutilPy =
+      Platform.script.resolve("../third_party/gsutil/gsutil.py").toFilePath();
+
   final builder = options["builder"];
 
   // Find out where the current HEAD branched.