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

Invalidate local LLVM cache less often #77126

Merged
merged 2 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ changelog-seen = 1
# toolchain or changing LLVM locally, you probably want to set this to true.
#
# It's currently false by default due to being newly added; please file bugs if
# enabling this did not work for you on Linux (macOS and Windows support is
# coming soon).
# enabling this did not work for you on x86_64-unknown-linux-gnu.
# Other target triples are currently not supported; see #77084.
#
# We also currently only support this when building LLVM for the build triple.
#
Expand Down Expand Up @@ -380,7 +380,7 @@ changelog-seen = 1

# Whether or not to leave debug! and trace! calls in the rust binary.
# Overrides the `debug-assertions` option, if defined.
#
#
# Defaults to rust.debug-assertions value
#debug-logging = debug-assertions

Expand Down
15 changes: 13 additions & 2 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,19 @@ def download_stage0(self):
rustfmt_stamp.write(self.date + self.rustfmt_channel)

if self.downloading_llvm():
llvm_sha = subprocess.check_output(["git", "log", "--author=bors",
"--format=%H", "-n1"]).decode(sys.getdefaultencoding()).strip()
# We want the most recent LLVM submodule update to avoid downloading
# LLVM more often than necessary.
#
# This git command finds that commit SHA, looking for bors-authored
# merges that modified src/llvm-project.
#
# This works even in a repository that has not yet initialized
# submodules.
llvm_sha = subprocess.check_output([
"git", "log", "--author=bors", "--format=%H", "-n1",
"-m", "--first-parent",
"--", "src/llvm-project"
]).decode(sys.getdefaultencoding()).strip()
llvm_assertions = self.get_toml('assertions', 'llvm') == 'true'
if self.program_out_of_date(self.llvm_stamp(), llvm_sha + str(llvm_assertions)):
self._download_ci_llvm(llvm_sha, llvm_assertions)
Expand Down