Skip to content

Commit de62272

Browse files
authored
Rollup merge of #79156 - jyn514:relative-llvm, r=Mark-Simulacrum
Allow using `download-ci-llvm` from directories other than the root Previously, bootstrap.py would attempt to find the LLVM commit from `src/llvm-project`. However, it assumed it was always being run from the top-level directory, which isn't always the case. Before: ``` downloading https://ci-artifacts.rust-lang.org/rustc-builds//rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz curl: (22) The requested URL returned error: 404 failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmppyh4w8 https://ci-artifacts.rust-lang.org/rustc-builds//rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz Build completed unsuccessfully in 0:00:02 ``` After: ``` downloading https://ci-artifacts.rust-lang.org/rustc-builds/430feb24a46993e5073c1bb1b39da190d83fa2bf/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz ###################################################################################################################################################################### 100.0% extracting /home/joshua/rustc/src/bootstrap/build/cache/llvm-430feb24a46993e5073c1bb1b39da190d83fa2bf-False/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz ``` r? ```@Mark-Simulacrum``` cc ```@pnkfelix```
2 parents 3b857a5 + 5163912 commit de62272

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/bootstrap/bootstrap.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,15 @@ def download_stage0(self):
437437
#
438438
# This works even in a repository that has not yet initialized
439439
# submodules.
440+
top_level = subprocess.check_output([
441+
"git", "rev-parse", "--show-toplevel",
442+
]).decode(sys.getdefaultencoding()).strip()
440443
llvm_sha = subprocess.check_output([
441444
"git", "log", "--author=bors", "--format=%H", "-n1",
442445
"-m", "--first-parent",
443446
"--",
444-
"src/llvm-project",
445-
"src/bootstrap/download-ci-llvm-stamp",
447+
"{}/src/llvm-project".format(top_level),
448+
"{}/src/bootstrap/download-ci-llvm-stamp".format(top_level),
446449
]).decode(sys.getdefaultencoding()).strip()
447450
llvm_assertions = self.get_toml('assertions', 'llvm') == 'true'
448451
if self.program_out_of_date(self.llvm_stamp(), llvm_sha + str(llvm_assertions)):

0 commit comments

Comments
 (0)