Skip to content

Commit 613f449

Browse files
committed
rustbuild: Fix building from an empty directory
A stray shutil.rmtree happened when it shouldn't have happened, causing the entire build to fail.
1 parent f25f0e8 commit 613f449

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bootstrap/bootstrap.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def download_rust_nightly(self):
7373

7474
if self.rustc().startswith(self.bin_root()) and \
7575
(not os.path.exists(self.rustc()) or self.rustc_out_of_date()):
76-
shutil.rmtree(self.bin_root())
76+
if os.path.exists(self.bin_root()):
77+
shutil.rmtree(self.bin_root())
7778
filename = "rust-std-nightly-" + self.build + ".tar.gz"
7879
url = "https://static.rust-lang.org/dist/" + self.snap_rustc_date()
7980
tarball = os.path.join(rustc_cache, filename)

0 commit comments

Comments
 (0)