@@ -26,6 +26,7 @@ use crate::core::build_steps::tool::{self, Tool};
2626use crate :: core:: builder:: { Builder , Kind , RunConfig , ShouldRun , Step } ;
2727use crate :: core:: config:: TargetSelection ;
2828use crate :: utils:: channel:: { self , Info } ;
29+ use crate :: utils:: exec:: BootstrapCommand ;
2930use crate :: utils:: helpers:: {
3031 exe, is_dylib, move_file, output, t, target_supports_cranelift_backend, timeit,
3132} ;
@@ -1599,14 +1600,14 @@ impl Step for Extended {
15991600 let _ = fs:: remove_dir_all ( & pkg) ;
16001601
16011602 let pkgbuild = |component : & str | {
1602- let mut cmd = Command :: new ( "pkgbuild" ) ;
1603+ let mut cmd = BootstrapCommand :: new ( "pkgbuild" ) ;
16031604 cmd. arg ( "--identifier" )
16041605 . arg ( format ! ( "org.rust-lang.{}" , component) )
16051606 . arg ( "--scripts" )
16061607 . arg ( pkg. join ( component) )
16071608 . arg ( "--nopayload" )
16081609 . arg ( pkg. join ( component) . with_extension ( "pkg" ) ) ;
1609- builder. run ( & mut cmd) ;
1610+ builder. run ( cmd) ;
16101611 } ;
16111612
16121613 let prepare = |name : & str | {
@@ -1636,7 +1637,7 @@ impl Step for Extended {
16361637 builder. create_dir ( & pkg. join ( "res" ) ) ;
16371638 builder. create ( & pkg. join ( "res/LICENSE.txt" ) , & license) ;
16381639 builder. install ( & etc. join ( "gfx/rust-logo.png" ) , & pkg. join ( "res" ) , 0o644 ) ;
1639- let mut cmd = Command :: new ( "productbuild" ) ;
1640+ let mut cmd = BootstrapCommand :: new ( "productbuild" ) ;
16401641 cmd. arg ( "--distribution" )
16411642 . arg ( xform ( & etc. join ( "pkg/Distribution.xml" ) ) )
16421643 . arg ( "--resources" )
@@ -1649,7 +1650,7 @@ impl Step for Extended {
16491650 . arg ( "--package-path" )
16501651 . arg ( & pkg) ;
16511652 let _time = timeit ( builder) ;
1652- builder. run ( & mut cmd) ;
1653+ builder. run ( cmd) ;
16531654 }
16541655
16551656 if target. is_windows ( ) {
@@ -1704,7 +1705,7 @@ impl Step for Extended {
17041705
17051706 let heat_flags = [ "-nologo" , "-gg" , "-sfrag" , "-srd" , "-sreg" ] ;
17061707 builder. run (
1707- Command :: new ( & heat)
1708+ BootstrapCommand :: new ( & heat)
17081709 . current_dir ( & exe)
17091710 . arg ( "dir" )
17101711 . arg ( "rustc" )
@@ -1720,7 +1721,7 @@ impl Step for Extended {
17201721 ) ;
17211722 if built_tools. contains ( "rust-docs" ) {
17221723 builder. run (
1723- Command :: new ( & heat)
1724+ BootstrapCommand :: new ( & heat)
17241725 . current_dir ( & exe)
17251726 . arg ( "dir" )
17261727 . arg ( "rust-docs" )
@@ -1738,7 +1739,7 @@ impl Step for Extended {
17381739 ) ;
17391740 }
17401741 builder. run (
1741- Command :: new ( & heat)
1742+ BootstrapCommand :: new ( & heat)
17421743 . current_dir ( & exe)
17431744 . arg ( "dir" )
17441745 . arg ( "cargo" )
@@ -1755,7 +1756,7 @@ impl Step for Extended {
17551756 . arg ( etc. join ( "msi/remove-duplicates.xsl" ) ) ,
17561757 ) ;
17571758 builder. run (
1758- Command :: new ( & heat)
1759+ BootstrapCommand :: new ( & heat)
17591760 . current_dir ( & exe)
17601761 . arg ( "dir" )
17611762 . arg ( "rust-std" )
@@ -1771,7 +1772,7 @@ impl Step for Extended {
17711772 ) ;
17721773 if built_tools. contains ( "rust-analyzer" ) {
17731774 builder. run (
1774- Command :: new ( & heat)
1775+ BootstrapCommand :: new ( & heat)
17751776 . current_dir ( & exe)
17761777 . arg ( "dir" )
17771778 . arg ( "rust-analyzer" )
@@ -1790,7 +1791,7 @@ impl Step for Extended {
17901791 }
17911792 if built_tools. contains ( "clippy" ) {
17921793 builder. run (
1793- Command :: new ( & heat)
1794+ BootstrapCommand :: new ( & heat)
17941795 . current_dir ( & exe)
17951796 . arg ( "dir" )
17961797 . arg ( "clippy" )
@@ -1809,7 +1810,7 @@ impl Step for Extended {
18091810 }
18101811 if built_tools. contains ( "miri" ) {
18111812 builder. run (
1812- Command :: new ( & heat)
1813+ BootstrapCommand :: new ( & heat)
18131814 . current_dir ( & exe)
18141815 . arg ( "dir" )
18151816 . arg ( "miri" )
@@ -1827,7 +1828,7 @@ impl Step for Extended {
18271828 ) ;
18281829 }
18291830 builder. run (
1830- Command :: new ( & heat)
1831+ BootstrapCommand :: new ( & heat)
18311832 . current_dir ( & exe)
18321833 . arg ( "dir" )
18331834 . arg ( "rust-analysis" )
@@ -1845,7 +1846,7 @@ impl Step for Extended {
18451846 ) ;
18461847 if target. ends_with ( "windows-gnu" ) {
18471848 builder. run (
1848- Command :: new ( & heat)
1849+ BootstrapCommand :: new ( & heat)
18491850 . current_dir ( & exe)
18501851 . arg ( "dir" )
18511852 . arg ( "rust-mingw" )
@@ -1864,7 +1865,7 @@ impl Step for Extended {
18641865 let candle = |input : & Path | {
18651866 let output = exe. join ( input. file_stem ( ) . unwrap ( ) ) . with_extension ( "wixobj" ) ;
18661867 let arch = if target. contains ( "x86_64" ) { "x64" } else { "x86" } ;
1867- let mut cmd = Command :: new ( & candle) ;
1868+ let mut cmd = BootstrapCommand :: new ( & candle) ;
18681869 cmd. current_dir ( & exe)
18691870 . arg ( "-nologo" )
18701871 . arg ( "-dRustcDir=rustc" )
@@ -1893,7 +1894,7 @@ impl Step for Extended {
18931894 if target. ends_with ( "windows-gnu" ) {
18941895 cmd. arg ( "-dGccDir=rust-mingw" ) ;
18951896 }
1896- builder. run ( & mut cmd) ;
1897+ builder. run ( cmd) ;
18971898 } ;
18981899 candle ( & xform ( & etc. join ( "msi/rust.wxs" ) ) ) ;
18991900 candle ( & etc. join ( "msi/ui.wxs" ) ) ;
@@ -1925,7 +1926,7 @@ impl Step for Extended {
19251926
19261927 builder. info ( & format ! ( "building `msi` installer with {light:?}" ) ) ;
19271928 let filename = format ! ( "{}-{}.msi" , pkgname( builder, "rust" ) , target. triple) ;
1928- let mut cmd = Command :: new ( & light) ;
1929+ let mut cmd = BootstrapCommand :: new ( & light) ;
19291930 cmd. arg ( "-nologo" )
19301931 . arg ( "-ext" )
19311932 . arg ( "WixUIExtension" )
@@ -1962,7 +1963,7 @@ impl Step for Extended {
19621963 cmd. arg ( "-sice:ICE57" ) ;
19631964
19641965 let _time = timeit ( builder) ;
1965- builder. run ( & mut cmd) ;
1966+ builder. run ( cmd) ;
19661967
19671968 if !builder. config . dry_run ( ) {
19681969 t ! ( move_file( exe. join( & filename) , distdir( builder) . join( & filename) ) ) ;
@@ -1971,7 +1972,7 @@ impl Step for Extended {
19711972 }
19721973}
19731974
1974- fn add_env ( builder : & Builder < ' _ > , cmd : & mut Command , target : TargetSelection ) {
1975+ fn add_env ( builder : & Builder < ' _ > , cmd : & mut BootstrapCommand , target : TargetSelection ) {
19751976 let mut parts = builder. version . split ( '.' ) ;
19761977 cmd. env ( "CFG_RELEASE_INFO" , builder. rust_version ( ) )
19771978 . env ( "CFG_RELEASE_NUM" , & builder. version )
0 commit comments