Skip to content

Commit 6d4e3c1

Browse files
committed
Auto merge of #84750 - jyn514:nix-cargo, r=Mark-Simulacrum
Don't download cargo twice when download-rustc is set Previously, this caused a bug on NixOS: 1. bootstrap.py would download and patch stage0/cargo 2. bootstrap.py would download nightly cargo, but extract it to stage0/cargo instead of ci-rustc/cargo. It would still try (and fail) to patch ci-rustc/cargo. 3. bootstrap.py would fail to build rustbuild because stage0/cargo wasn't patched. The "proper" fix is to extract nightly cargo to ci-rustc instead, but it doesn't seem to be necessary at all, so this just skips downloading it instead. Fixes #84702
2 parents e244e84 + 69f3ead commit 6d4e3c1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/bootstrap/bootstrap.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -414,18 +414,20 @@ def download_toolchain(self, stage0=True, rustc_channel=None):
414414
filename = "rustc-{}-{}{}".format(rustc_channel, self.build,
415415
tarball_suffix)
416416
self._download_component_helper(filename, "rustc", tarball_suffix, stage0)
417-
filename = "cargo-{}-{}{}".format(rustc_channel, self.build,
418-
tarball_suffix)
419-
self._download_component_helper(filename, "cargo", tarball_suffix)
420-
if not stage0:
417+
# download-rustc doesn't need its own cargo, it can just use beta's.
418+
if stage0:
419+
filename = "cargo-{}-{}{}".format(rustc_channel, self.build,
420+
tarball_suffix)
421+
self._download_component_helper(filename, "cargo", tarball_suffix)
422+
self.fix_bin_or_dylib("{}/bin/cargo".format(bin_root))
423+
else:
421424
filename = "rustc-dev-{}-{}{}".format(rustc_channel, self.build, tarball_suffix)
422425
self._download_component_helper(
423426
filename, "rustc-dev", tarball_suffix, stage0
424427
)
425428

426429
self.fix_bin_or_dylib("{}/bin/rustc".format(bin_root))
427430
self.fix_bin_or_dylib("{}/bin/rustdoc".format(bin_root))
428-
self.fix_bin_or_dylib("{}/bin/cargo".format(bin_root))
429431
lib_dir = "{}/lib".format(bin_root)
430432
for lib in os.listdir(lib_dir):
431433
if lib.endswith(".so"):

0 commit comments

Comments
 (0)