Skip to content

Commit 94597e8

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

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

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

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

0 commit comments

Comments
 (0)