]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/download.rs
Download rustc component for rustfmt toolchain as well
[rust.git] / src / bootstrap / download.rs
index 6ae283f32a5f3a9080edd104a4cf46bc01b3376d..1be7c6777a791efc11d4c2ffa98aee146bb4ec54 100644 (file)
@@ -318,15 +318,27 @@ pub(crate) fn maybe_download_rustfmt(&self) -> Option<PathBuf> {
         let channel = format!("{version}-{date}");
 
         let host = self.build;
-        let rustfmt_path = self.initial_rustc.with_file_name(exe("rustfmt", host));
-        let bin_root = self.out.join(host.triple).join("stage0");
+        let bin_root = self.out.join(host.triple).join("rustfmt");
+        let rustfmt_path = bin_root.join("bin").join(exe("rustfmt", host));
         let rustfmt_stamp = bin_root.join(".rustfmt-stamp");
         if rustfmt_path.exists() && !program_out_of_date(&rustfmt_stamp, &channel) {
             return Some(rustfmt_path);
         }
 
-        let filename = format!("rustfmt-{version}-{build}.tar.xz", build = host.triple);
-        self.download_component(DownloadSource::Dist, filename, "rustfmt-preview", &date, "stage0");
+        self.download_component(
+            DownloadSource::Dist,
+            format!("rustfmt-{version}-{build}.tar.xz", build = host.triple),
+            "rustfmt-preview",
+            &date,
+            "rustfmt",
+        );
+        self.download_component(
+            DownloadSource::Dist,
+            format!("rustc-{version}-{build}.tar.xz", build = host.triple),
+            "rustc",
+            &date,
+            "rustfmt",
+        );
 
         self.fix_bin_or_dylib(&bin_root.join("bin").join("rustfmt"));
         self.fix_bin_or_dylib(&bin_root.join("bin").join("cargo-fmt"));