Roll recipe dependencies (trivial).

This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).


More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
depot_tools:
  https://crrev.com/9198ef8ede661f96912f5f226d566ae1f1998f7b [bot_update] Default to refs/heads/master (nodir@google.com)
recipe_engine:
  https://crrev.com/4885460fce04564eccdc6d03503934ec32fcc0c9 Exit early if required binaries aren't found on PATH (garymm@google.com)
  https://crrev.com/51acda8019760f9d510d3b3343a934c0fddcd7d0 [buildbucket] Add is_critical help function (nodir@google.com)


TBR=borenet@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: I98ec24631f7fbdb912cd995c46fb6fc267f1b630
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206275
Reviewed-by: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
diff --git a/infra/bots/recipes.py b/infra/bots/recipes.py
index 6e99fbd..2fe0086 100755
--- a/infra/bots/recipes.py
+++ b/infra/bots/recipes.py
@@ -100,6 +100,20 @@
 _BAT = '.bat' if sys.platform.startswith(('win', 'cygwin')) else ''
 GIT = 'git' + _BAT
 VPYTHON = 'vpython' + _BAT
+CIPD = 'cipd' + _BAT
+REQUIRED_BINARIES = {GIT, VPYTHON, CIPD}
+
+
+def _is_executable(path):
+  return os.path.isfile(path) and os.access(path, os.X_OK)
+
+# TODO: Use shutil.which once we switch to Python3.
+def _is_on_path(basename):
+  for path in os.environ['PATH'].split(os.pathsep):
+    full_path = os.path.join(path, basename)
+    if _is_executable(full_path):
+      return True
+  return False
 
 
 def _subprocess_call(argv, **kwargs):
@@ -179,6 +193,10 @@
 
 
 def main():
+  for required_binary in REQUIRED_BINARIES:
+    if not _is_on_path(required_binary):
+      return 'Required binary is not found on PATH: %s' % required_binary
+
   if '--verbose' in sys.argv:
     logging.getLogger().setLevel(logging.INFO)