Skip to content

Commit b27b57a

Browse files
Recompress by channel, and ignore nightly
1 parent 8e1182c commit b27b57a

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

src/main.rs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,25 @@ impl Context {
175175

176176
// Quickly produce gzip compressed artifacts that are needed for successful manifest
177177
// building.
178-
let recompress = [
179-
self.dl_dir()
180-
.join("rust-nightly-x86_64-unknown-linux-gnu.tar.xz"),
181-
self.dl_dir()
182-
.join("cargo-nightly-x86_64-unknown-linux-gnu.tar.xz"),
183-
];
184-
recompress.par_iter().try_for_each(|tarball| {
185-
recompress::recompress_file(tarball, false, flate2::Compression::fast(), false)
186-
})?;
178+
//
179+
// Nightly (1.71+) supports this upstream without the extra recompression, see
180+
// https://github.com/rust-lang/rust/pull/110436.
181+
if self.config.channel != Channel::Nightly {
182+
let version = match self.config.channel {
183+
Channel::Stable => self.current_version.as_deref().unwrap(),
184+
Channel::Beta => "beta",
185+
Channel::Nightly => "nightly",
186+
};
187+
let recompress = [
188+
self.dl_dir()
189+
.join(format!("rust-{}-x86_64-unknown-linux-gnu.tar.xz", version)),
190+
self.dl_dir()
191+
.join(format!("cargo-{}-x86_64-unknown-linux-gnu.tar.xz", version)),
192+
];
193+
recompress.par_iter().try_for_each(|tarball| {
194+
recompress::recompress_file(tarball, false, flate2::Compression::fast(), false)
195+
})?;
196+
}
187197

188198
// Ok we've now determined that a release needs to be done.
189199

0 commit comments

Comments
 (0)