Skip to content

Commit 7d07cfb

Browse files
authored
Rollup merge of #85996 - jyn514:library-changes, r=Mark-Simulacrum
rustbuild: take changes to the standard library into account for `download-rustc` Previously, changing the standard library with `download-rustc = "if-unchanged"` would incorrectly reuse the cached compiler and standard library from CI, which was confusing and led to incorrect test failures or successes. r? `@Mark-Simulacrum`
2 parents 7fcfe05 + 261d16a commit 7d07cfb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bootstrap/bootstrap.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -648,18 +648,20 @@ def maybe_download_ci_toolchain(self):
648648
rev_parse = ["git", "rev-parse", "--show-toplevel"]
649649
top_level = subprocess.check_output(rev_parse, universal_newlines=True).strip()
650650
compiler = "{}/compiler/".format(top_level)
651+
library = "{}/library/".format(top_level)
651652

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

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

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

0 commit comments

Comments
 (0)