Skip to content

Commit 61dc57c

Browse files
Rollup merge of #77126 - Mark-Simulacrum:llvm-less-often, r=alexcrichton
Invalidate local LLVM cache less often This avoids a download of LLVM after every rebase. The downside to this is that if we land some patch affecting LLVM built in CI that breaks this option, but that PR does not update the LLVM submodule, we'll likely not notice until the next update -- but this seems unlikely to happen in practice and I am not personally worried about it. r? @alexcrichton
2 parents 0a3cf02 + ef95430 commit 61dc57c

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

config.toml.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ changelog-seen = 1
3636
# toolchain or changing LLVM locally, you probably want to set this to true.
3737
#
3838
# It's currently false by default due to being newly added; please file bugs if
39-
# enabling this did not work for you on Linux (macOS and Windows support is
40-
# coming soon).
39+
# enabling this did not work for you on x86_64-unknown-linux-gnu.
40+
# Other target triples are currently not supported; see #77084.
4141
#
4242
# We also currently only support this when building LLVM for the build triple.
4343
#
@@ -380,7 +380,7 @@ changelog-seen = 1
380380

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

src/bootstrap/bootstrap.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,19 @@ def download_stage0(self):
424424
rustfmt_stamp.write(self.date + self.rustfmt_channel)
425425

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

0 commit comments

Comments
 (0)