Skip to content

Commit

Permalink
handle stage0 cargo and rustc separately
Browse files Browse the repository at this point in the history
This change allows setting either `build.cargo` or `build.rustc` without requiring
both to be set simultaneously, which was not possible previously.

To try it, set `build.rustc` without setting `build.cargo`, and try to bootstrap on clean build.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Aug 23, 2024
1 parent a32d4a0 commit 98fc12d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def download_toolchain(self):
bin_root = self.bin_root()

key = self.stage0_compiler.date
if self.rustc().startswith(bin_root) and \
if (self.rustc().startswith(bin_root) or self.cargo().startswith(bin_root)) and \
(not os.path.exists(self.rustc()) or
self.program_out_of_date(self.rustc_stamp(), key)):
if os.path.exists(bin_root):
Expand Down Expand Up @@ -568,11 +568,16 @@ def download_toolchain(self):

toolchain_suffix = "{}-{}{}".format(rustc_channel, self.build, tarball_suffix)

tarballs_to_download = [
("rust-std-{}".format(toolchain_suffix), "rust-std-{}".format(self.build)),
("rustc-{}".format(toolchain_suffix), "rustc"),
("cargo-{}".format(toolchain_suffix), "cargo"),
]
tarballs_to_download = []

if self.rustc().startswith(bin_root):
tarballs_to_download.append(
("rust-std-{}".format(toolchain_suffix), "rust-std-{}".format(self.build))
)
tarballs_to_download.append(("rustc-{}".format(toolchain_suffix), "rustc"))

if self.cargo().startswith(bin_root):
tarballs_to_download.append(("cargo-{}".format(toolchain_suffix), "cargo"))

tarballs_download_info = [
DownloadInfo(
Expand Down

0 comments on commit 98fc12d

Please sign in to comment.