Skip to content

Commit

Permalink
bootstrap: don't use --merges to find commits
Browse files Browse the repository at this point in the history
Shallow clones can cause `git rev-list --merges` to miss merge
commits. Omit it, because the most recent bors commit is
almost always a merge commit.
  • Loading branch information
tlyu committed Oct 7, 2021
1 parent 5641481 commit 6ff7204
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def download_toolchain(self, stage0=True, rustc_channel=None):
# LLVM more often than necessary.
#
# This git command finds that commit SHA, looking for bors-authored
# merges that modified src/llvm-project or other relevant version
# commits that modified src/llvm-project or other relevant version
# stamp files.
#
# This works even in a repository that has not yet initialized
Expand All @@ -470,7 +470,7 @@ def download_toolchain(self, stage0=True, rustc_channel=None):
]).decode(sys.getdefaultencoding()).strip()
llvm_sha = subprocess.check_output([
"git", "rev-list", "--author=bors@rust-lang.org", "-n1",
"--merges", "--first-parent", "HEAD",
"--first-parent", "HEAD",
"--",
"{}/src/llvm-project".format(top_level),
"{}/src/bootstrap/download-ci-llvm-stamp".format(top_level),
Expand Down Expand Up @@ -685,7 +685,7 @@ def maybe_download_ci_toolchain(self):
# Only commits merged by bors will have CI artifacts.
merge_base = [
"git", "rev-list", "--author=bors@rust-lang.org", "-n1",
"--merges", "--first-parent", "HEAD"
"--first-parent", "HEAD"
]
commit = subprocess.check_output(merge_base, universal_newlines=True).strip()

Expand Down

0 comments on commit 6ff7204

Please sign in to comment.