about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorGuanqun Lu <guanqun.lu@gmail.com>2019-09-04 23:49:30 +0800
committerGuanqun Lu <guanqun.lu@gmail.com>2019-09-09 22:28:57 +0800
commitb117bd7366b38061ec91697f9f2c6d1736e01aa4 (patch)
tree7b3c6061a87d8cc2737b799172c51eb88f530acd /src/bootstrap
parent824383d4ab66abd32abc6e19b68d78ecfddcb7d4 (diff)
downloadrust-b117bd7366b38061ec91697f9f2c6d1736e01aa4.tar.gz
rust-b117bd7366b38061ec91697f9f2c6d1736e01aa4.zip
check git in bootstrap.py when trying to update submodule
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bootstrap.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 14bc90700b7..65129eeeec5 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -708,6 +708,14 @@ class RustBuild(object):
         if (not os.path.exists(os.path.join(self.rust_root, ".git"))) or \
                 self.get_toml('submodules') == "false":
             return
+
+        # check the existence of 'git' command
+        try:
+            subprocess.check_output(['git', '--version'])
+        except (subprocess.CalledProcessError, OSError):
+            print("error: `git` is not found, please make sure it's installed and in the path.")
+            sys.exit(1)
+
         slow_submodules = self.get_toml('fast-submodules') == "false"
         start_time = time()
         if slow_submodules: