From e0d7a591a52da064727e4ae143ef6ae1364c5d02 Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Tue, 27 Jul 2021 19:58:16 -0500 Subject: [PATCH] boostrap.py: only look for merges by bors Only look for commits by bors that are merge commits, because those are the only ones with CI artifacts. Also, use `--first-parent` to avoid traversing stuff like rollup branches. --- src/bootstrap/bootstrap.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 41d88950ef9..3faf38c66ec 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -464,7 +464,7 @@ class RustBuild(object): # LLVM more often than necessary. # # This git command finds that commit SHA, looking for bors-authored - # commits that modified src/llvm-project or other relevant version + # merges that modified src/llvm-project or other relevant version # stamp files. # # This works even in a repository that has not yet initialized @@ -474,7 +474,7 @@ class RustBuild(object): ]).decode(sys.getdefaultencoding()).strip() llvm_sha = subprocess.check_output([ "git", "rev-list", "--author=bors@rust-lang.org", "-n1", - "--first-parent", "HEAD", + "--merges", "--first-parent", "HEAD", "--", "{}/src/llvm-project".format(top_level), "{}/src/bootstrap/download-ci-llvm-stamp".format(top_level), @@ -666,7 +666,10 @@ class RustBuild(object): # Look for a version to compare to based on the current commit. # Only commits merged by bors will have CI artifacts. - merge_base = ["git", "rev-list", "--author=bors@rust-lang.org", "-n1", "HEAD"] + merge_base = [ + "git", "rev-list", "--author=bors@rust-lang.org", "-n1", + "--merges", "--first-parent", "HEAD" + ] commit = subprocess.check_output(merge_base, universal_newlines=True).strip() # Warn if there were changes to the compiler or standard library since the ancestor commit.