]> git.lizzy.rs Git - rust.git/commitdiff
intelligently handle older version of git in bootstrap
authorNathan Froyd <froydnj@gmail.com>
Mon, 29 Apr 2019 21:01:42 +0000 (17:01 -0400)
committerNathan Froyd <froydnj@gmail.com>
Mon, 29 Apr 2019 21:01:42 +0000 (17:01 -0400)
If we fail to run with `--progress`, try running without instead.

Fixes #57080.

src/bootstrap/bootstrap.py

index 8af7aa4856c381c196466407833370e7841c7ac1..86c82adffa9b09bbccc99f899b19e37127847d8b 100644 (file)
@@ -677,9 +677,15 @@ class RustBuild(object):
 
         run(["git", "submodule", "-q", "sync", module],
             cwd=self.rust_root, verbose=self.verbose)
-        run(["git", "submodule", "update",
-            "--init", "--recursive", "--progress", module],
-            cwd=self.rust_root, verbose=self.verbose)
+        try:
+            run(["git", "submodule", "update",
+                 "--init", "--recursive", "--progress", module],
+                cwd=self.rust_root, verbose=self.verbose, exception=True)
+        except RuntimeError:
+            # Some versions of git don't support --progress.
+            run(["git", "submodule", "update",
+                 "--init", "--recursive", module],
+                cwd=self.rust_root, verbose=self.verbose)
         run(["git", "reset", "-q", "--hard"],
             cwd=module_path, verbose=self.verbose)
         run(["git", "clean", "-qdfx"],