Skip to content

Commit 953612a

Browse files
committed
force dist.compression-profile = "no-op" for x install
Signed-off-by: onur-ozkan <[email protected]>
1 parent d6b0fab commit 953612a

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/bootstrap/src/utils/tarball.rs

+17-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use std::{
33
process::Command,
44
};
55

6-
use crate::core::build_steps::dist::distdir;
76
use crate::core::builder::Builder;
7+
use crate::core::{build_steps::dist::distdir, builder::Kind};
88
use crate::utils::channel;
99
use crate::utils::helpers::t;
1010

@@ -326,7 +326,22 @@ impl<'a> Tarball<'a> {
326326
assert!(!formats.is_empty(), "dist.compression-formats can't be empty");
327327
cmd.arg("--compression-formats").arg(formats.join(","));
328328
}
329-
cmd.args(&["--compression-profile", &self.builder.config.dist_compression_profile]);
329+
330+
// For `x install` tarball files aren't needed, so we can speed up the process by not producing them.
331+
let compression_profile = if self.builder.kind == Kind::Install {
332+
self.builder.verbose("Forcing dist.compression-profile = 'no-op' for `x install`.");
333+
// "no-op" indicates that the rust-installer won't produce compressed tarball sources.
334+
"no-op"
335+
} else {
336+
assert!(
337+
self.builder.config.dist_compression_profile != "no-op",
338+
"dist.compression-profile = 'no-op' can only be used for `x install`"
339+
);
340+
341+
&self.builder.config.dist_compression_profile
342+
};
343+
344+
cmd.args(&["--compression-profile", compression_profile]);
330345
self.builder.run(&mut cmd);
331346

332347
// Ensure there are no symbolic links in the tarball. In particular,

0 commit comments

Comments
 (0)