Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustbuild: take changes to the standard library into account for download-rustc #85996

Merged
merged 1 commit into from
Jun 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,18 +648,20 @@ def maybe_download_ci_toolchain(self):
rev_parse = ["git", "rev-parse", "--show-toplevel"]
top_level = subprocess.check_output(rev_parse, universal_newlines=True).strip()
compiler = "{}/compiler/".format(top_level)
library = "{}/library/".format(top_level)

# Look for a version to compare to based on the current commit.
# Only commits merged by bors will have CI artifacts.
merge_base = ["git", "log", "--author=bors", "--pretty=%H", "-n1"]
commit = subprocess.check_output(merge_base, universal_newlines=True).strip()

# Warn if there were changes to the compiler since the ancestor commit.
status = subprocess.call(["git", "diff-index", "--quiet", commit, "--", compiler])
# Warn if there were changes to the compiler or standard library since the ancestor commit.
status = subprocess.call(["git", "diff-index", "--quiet", commit, "--", compiler, library])
if status != 0:
if download_rustc == "if-unchanged":
return None
print("warning: `download-rustc` is enabled, but there are changes to compiler/")
print("warning: `download-rustc` is enabled, but there are changes to \
compiler/ or library/")

if self.verbose:
print("using downloaded stage1 artifacts from CI (commit {})".format(commit))
Expand Down