Skip to content

Commit 5163912

Browse files
committed
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 ```
1 parent c919f49 commit 5163912

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
@@ -447,12 +447,15 @@ def download_stage0(self):
447447
#
448448
# This works even in a repository that has not yet initialized
449449
# submodules.
450+
top_level = subprocess.check_output([
451+
"git", "rev-parse", "--show-toplevel",
452+
]).decode(sys.getdefaultencoding()).strip()
450453
llvm_sha = subprocess.check_output([
451454
"git", "log", "--author=bors", "--format=%H", "-n1",
452455
"-m", "--first-parent",
453456
"--",
454-
"src/llvm-project",
455-
"src/bootstrap/download-ci-llvm-stamp",
457+
"{}/src/llvm-project".format(top_level),
458+
"{}/src/bootstrap/download-ci-llvm-stamp".format(top_level),
456459
]).decode(sys.getdefaultencoding()).strip()
457460
llvm_assertions = self.get_toml('assertions', 'llvm') == 'true'
458461
if self.program_out_of_date(self.llvm_stamp(), llvm_sha + str(llvm_assertions)):

0 commit comments

Comments
 (0)