]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #107470 - kadiwa4:bootstrap_cleanup, r=albertlarsan68
authorMatthias Krüger <matthias.krueger@famsik.de>
Wed, 1 Feb 2023 04:54:38 +0000 (05:54 +0100)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 04:54:38 +0000 (05:54 +0100)
Small bootstrap improvements

- i/o-less check for `xz` availability
- cache result of NixOS detection
- load correct `bootstrap` module even when a package of that name is installed
- no `-W semicolon_in_expressions_from_macros` – it is warn-by-default
- one type per variable (making dynamic typing less confusing)
- integrate python-side `--help` flag into the argument parser (makes `-hv` work as a short form of `--help --verbose`)

I even checked that it works with Python 2.

1  2 
src/bootstrap/download.rs

index 1be7c6777a791efc11d4c2ffa98aee146bb4ec54,108b9636cda4a453cd3535f5a106ccce88addafc..bd67978a7662ee1d61c9d572d6194c8b243276c0
@@@ -325,23 -335,13 +335,25 @@@ impl Config 
              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"));
+         if self.should_fix_bins_and_dylibs() {
+             self.fix_bin_or_dylib(&bin_root.join("bin").join("rustfmt"));
+             self.fix_bin_or_dylib(&bin_root.join("bin").join("cargo-fmt"));
+         }
  
          self.create(&rustfmt_stamp, &channel);
          Some(rustfmt_path)