Skip to content

Commit

Permalink
force dist.compression-profile = "no-op" for x install
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <[email protected]>
  • Loading branch information
onur-ozkan committed Feb 21, 2024
1 parent 3197aee commit 94597e8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/bootstrap/src/utils/tarball.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::{
process::Command,
};

use crate::core::build_steps::dist::distdir;
use crate::core::builder::Builder;
use crate::core::{build_steps::dist::distdir, builder::Kind};
use crate::utils::channel;
use crate::utils::helpers::t;

Expand Down Expand Up @@ -325,7 +325,22 @@ impl<'a> Tarball<'a> {
assert!(!formats.is_empty(), "dist.compression-formats can't be empty");
cmd.arg("--compression-formats").arg(formats.join(","));
}
cmd.args(["--compression-profile", &self.builder.config.dist_compression_profile]);

// For `x install` tarball files aren't needed, so we can speed up the process by not producing them.
let compression_profile = if self.builder.kind == Kind::Install {
self.builder.verbose("Forcing dist.compression-profile = 'no-op' for `x install`.");
// "no-op" indicates that the rust-installer won't produce compressed tarball sources.
"no-op"
} else {
assert!(
self.builder.config.dist_compression_profile != "no-op",
"dist.compression-profile = 'no-op' can only be used for `x install`"
);

&self.builder.config.dist_compression_profile
};

cmd.args(&["--compression-profile", compression_profile]);
self.builder.run(&mut cmd);

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

0 comments on commit 94597e8

Please sign in to comment.