Skip to content

Commit 5d28520

Browse files
committed
bootstrap.py: use git rev-list for robustness
Use `git rev-list` instead of `git log` to be more robust against UI changes in git. Also, use the full email address for bors, because `--author` uses a substring match.
1 parent 1259742 commit 5d28520

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/bootstrap/bootstrap.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -464,16 +464,17 @@ def download_toolchain(self, stage0=True, rustc_channel=None):
464464
# LLVM more often than necessary.
465465
#
466466
# This git command finds that commit SHA, looking for bors-authored
467-
# merges that modified src/llvm-project.
467+
# commits that modified src/llvm-project or other relevant version
468+
# stamp files.
468469
#
469470
# This works even in a repository that has not yet initialized
470471
# submodules.
471472
top_level = subprocess.check_output([
472473
"git", "rev-parse", "--show-toplevel",
473474
]).decode(sys.getdefaultencoding()).strip()
474475
llvm_sha = subprocess.check_output([
475-
"git", "log", "--author=bors", "--format=%H", "-n1",
476-
"--no-patch", "--first-parent",
476+
"git", "rev-list", "--author=bors@rust-lang.org", "-n1",
477+
"--first-parent", "HEAD",
477478
"--",
478479
"{}/src/llvm-project".format(top_level),
479480
"{}/src/bootstrap/download-ci-llvm-stamp".format(top_level),
@@ -665,7 +666,7 @@ def maybe_download_ci_toolchain(self):
665666

666667
# Look for a version to compare to based on the current commit.
667668
# Only commits merged by bors will have CI artifacts.
668-
merge_base = ["git", "log", "--author=bors", "--pretty=%H", "-n1"]
669+
merge_base = ["git", "rev-list", "--author=bors@rust-lang.org", "-n1", "HEAD"]
669670
commit = subprocess.check_output(merge_base, universal_newlines=True).strip()
670671

671672
# Warn if there were changes to the compiler or standard library since the ancestor commit.

0 commit comments

Comments
 (0)