@@ -3,8 +3,8 @@ use std::{
33 process:: Command ,
44} ;
55
6- use crate :: core:: build_steps:: dist:: distdir;
76use crate :: core:: builder:: Builder ;
7+ use crate :: core:: { build_steps:: dist:: distdir, builder:: Kind } ;
88use crate :: utils:: channel;
99use 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