diff options
| author | Nathan Froyd <froydnj@gmail.com> | 2019-04-29 17:01:42 -0400 |
|---|---|---|
| committer | Nathan Froyd <froydnj@gmail.com> | 2019-04-29 17:01:42 -0400 |
| commit | a0d63354f231ddec9b426f89420464fbaabcf410 (patch) | |
| tree | 988d7d1a2d44b909cfc3a9c72f0fa98a178b69eb | |
| parent | 00acb7b24337eb138c934bde7a1efa5ee6a8b797 (diff) | |
| download | rust-a0d63354f231ddec9b426f89420464fbaabcf410.tar.gz rust-a0d63354f231ddec9b426f89420464fbaabcf410.zip | |
intelligently handle older version of git in bootstrap
If we fail to run with `--progress`, try running without instead. Fixes #57080.
| -rw-r--r-- | src/bootstrap/bootstrap.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 8af7aa4856c..86c82adffa9 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -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"], |
