@@ -26,6 +26,7 @@ use crate::core::build_steps::tool::{self, Tool};
26
26
use crate :: core:: builder:: { Builder , Kind , RunConfig , ShouldRun , Step } ;
27
27
use crate :: core:: config:: TargetSelection ;
28
28
use crate :: utils:: channel:: { self , Info } ;
29
+ use crate :: utils:: exec:: BootstrapCommand ;
29
30
use crate :: utils:: helpers:: {
30
31
exe, is_dylib, move_file, output, t, target_supports_cranelift_backend, timeit,
31
32
} ;
@@ -1599,14 +1600,14 @@ impl Step for Extended {
1599
1600
let _ = fs:: remove_dir_all ( & pkg) ;
1600
1601
1601
1602
let pkgbuild = |component : & str | {
1602
- let mut cmd = Command :: new ( "pkgbuild" ) ;
1603
+ let mut cmd = BootstrapCommand :: new ( "pkgbuild" ) ;
1603
1604
cmd. arg ( "--identifier" )
1604
1605
. arg ( format ! ( "org.rust-lang.{}" , component) )
1605
1606
. arg ( "--scripts" )
1606
1607
. arg ( pkg. join ( component) )
1607
1608
. arg ( "--nopayload" )
1608
1609
. arg ( pkg. join ( component) . with_extension ( "pkg" ) ) ;
1609
- builder. run ( & mut cmd) ;
1610
+ builder. run ( cmd) ;
1610
1611
} ;
1611
1612
1612
1613
let prepare = |name : & str | {
@@ -1636,7 +1637,7 @@ impl Step for Extended {
1636
1637
builder. create_dir ( & pkg. join ( "res" ) ) ;
1637
1638
builder. create ( & pkg. join ( "res/LICENSE.txt" ) , & license) ;
1638
1639
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" ) ;
1640
1641
cmd. arg ( "--distribution" )
1641
1642
. arg ( xform ( & etc. join ( "pkg/Distribution.xml" ) ) )
1642
1643
. arg ( "--resources" )
@@ -1649,7 +1650,7 @@ impl Step for Extended {
1649
1650
. arg ( "--package-path" )
1650
1651
. arg ( & pkg) ;
1651
1652
let _time = timeit ( builder) ;
1652
- builder. run ( & mut cmd) ;
1653
+ builder. run ( cmd) ;
1653
1654
}
1654
1655
1655
1656
if target. is_windows ( ) {
@@ -1704,7 +1705,7 @@ impl Step for Extended {
1704
1705
1705
1706
let heat_flags = [ "-nologo" , "-gg" , "-sfrag" , "-srd" , "-sreg" ] ;
1706
1707
builder. run (
1707
- Command :: new ( & heat)
1708
+ BootstrapCommand :: new ( & heat)
1708
1709
. current_dir ( & exe)
1709
1710
. arg ( "dir" )
1710
1711
. arg ( "rustc" )
@@ -1720,7 +1721,7 @@ impl Step for Extended {
1720
1721
) ;
1721
1722
if built_tools. contains ( "rust-docs" ) {
1722
1723
builder. run (
1723
- Command :: new ( & heat)
1724
+ BootstrapCommand :: new ( & heat)
1724
1725
. current_dir ( & exe)
1725
1726
. arg ( "dir" )
1726
1727
. arg ( "rust-docs" )
@@ -1738,7 +1739,7 @@ impl Step for Extended {
1738
1739
) ;
1739
1740
}
1740
1741
builder. run (
1741
- Command :: new ( & heat)
1742
+ BootstrapCommand :: new ( & heat)
1742
1743
. current_dir ( & exe)
1743
1744
. arg ( "dir" )
1744
1745
. arg ( "cargo" )
@@ -1755,7 +1756,7 @@ impl Step for Extended {
1755
1756
. arg ( etc. join ( "msi/remove-duplicates.xsl" ) ) ,
1756
1757
) ;
1757
1758
builder. run (
1758
- Command :: new ( & heat)
1759
+ BootstrapCommand :: new ( & heat)
1759
1760
. current_dir ( & exe)
1760
1761
. arg ( "dir" )
1761
1762
. arg ( "rust-std" )
@@ -1771,7 +1772,7 @@ impl Step for Extended {
1771
1772
) ;
1772
1773
if built_tools. contains ( "rust-analyzer" ) {
1773
1774
builder. run (
1774
- Command :: new ( & heat)
1775
+ BootstrapCommand :: new ( & heat)
1775
1776
. current_dir ( & exe)
1776
1777
. arg ( "dir" )
1777
1778
. arg ( "rust-analyzer" )
@@ -1790,7 +1791,7 @@ impl Step for Extended {
1790
1791
}
1791
1792
if built_tools. contains ( "clippy" ) {
1792
1793
builder. run (
1793
- Command :: new ( & heat)
1794
+ BootstrapCommand :: new ( & heat)
1794
1795
. current_dir ( & exe)
1795
1796
. arg ( "dir" )
1796
1797
. arg ( "clippy" )
@@ -1809,7 +1810,7 @@ impl Step for Extended {
1809
1810
}
1810
1811
if built_tools. contains ( "miri" ) {
1811
1812
builder. run (
1812
- Command :: new ( & heat)
1813
+ BootstrapCommand :: new ( & heat)
1813
1814
. current_dir ( & exe)
1814
1815
. arg ( "dir" )
1815
1816
. arg ( "miri" )
@@ -1827,7 +1828,7 @@ impl Step for Extended {
1827
1828
) ;
1828
1829
}
1829
1830
builder. run (
1830
- Command :: new ( & heat)
1831
+ BootstrapCommand :: new ( & heat)
1831
1832
. current_dir ( & exe)
1832
1833
. arg ( "dir" )
1833
1834
. arg ( "rust-analysis" )
@@ -1845,7 +1846,7 @@ impl Step for Extended {
1845
1846
) ;
1846
1847
if target. ends_with ( "windows-gnu" ) {
1847
1848
builder. run (
1848
- Command :: new ( & heat)
1849
+ BootstrapCommand :: new ( & heat)
1849
1850
. current_dir ( & exe)
1850
1851
. arg ( "dir" )
1851
1852
. arg ( "rust-mingw" )
@@ -1864,7 +1865,7 @@ impl Step for Extended {
1864
1865
let candle = |input : & Path | {
1865
1866
let output = exe. join ( input. file_stem ( ) . unwrap ( ) ) . with_extension ( "wixobj" ) ;
1866
1867
let arch = if target. contains ( "x86_64" ) { "x64" } else { "x86" } ;
1867
- let mut cmd = Command :: new ( & candle) ;
1868
+ let mut cmd = BootstrapCommand :: new ( & candle) ;
1868
1869
cmd. current_dir ( & exe)
1869
1870
. arg ( "-nologo" )
1870
1871
. arg ( "-dRustcDir=rustc" )
@@ -1893,7 +1894,7 @@ impl Step for Extended {
1893
1894
if target. ends_with ( "windows-gnu" ) {
1894
1895
cmd. arg ( "-dGccDir=rust-mingw" ) ;
1895
1896
}
1896
- builder. run ( & mut cmd) ;
1897
+ builder. run ( cmd) ;
1897
1898
} ;
1898
1899
candle ( & xform ( & etc. join ( "msi/rust.wxs" ) ) ) ;
1899
1900
candle ( & etc. join ( "msi/ui.wxs" ) ) ;
@@ -1925,7 +1926,7 @@ impl Step for Extended {
1925
1926
1926
1927
builder. info ( & format ! ( "building `msi` installer with {light:?}" ) ) ;
1927
1928
let filename = format ! ( "{}-{}.msi" , pkgname( builder, "rust" ) , target. triple) ;
1928
- let mut cmd = Command :: new ( & light) ;
1929
+ let mut cmd = BootstrapCommand :: new ( & light) ;
1929
1930
cmd. arg ( "-nologo" )
1930
1931
. arg ( "-ext" )
1931
1932
. arg ( "WixUIExtension" )
@@ -1962,7 +1963,7 @@ impl Step for Extended {
1962
1963
cmd. arg ( "-sice:ICE57" ) ;
1963
1964
1964
1965
let _time = timeit ( builder) ;
1965
- builder. run ( & mut cmd) ;
1966
+ builder. run ( cmd) ;
1966
1967
1967
1968
if !builder. config . dry_run ( ) {
1968
1969
t ! ( move_file( exe. join( & filename) , distdir( builder) . join( & filename) ) ) ;
@@ -1971,7 +1972,7 @@ impl Step for Extended {
1971
1972
}
1972
1973
}
1973
1974
1974
- fn add_env ( builder : & Builder < ' _ > , cmd : & mut Command , target : TargetSelection ) {
1975
+ fn add_env ( builder : & Builder < ' _ > , cmd : & mut BootstrapCommand , target : TargetSelection ) {
1975
1976
let mut parts = builder. version . split ( '.' ) ;
1976
1977
cmd. env ( "CFG_RELEASE_INFO" , builder. rust_version ( ) )
1977
1978
. env ( "CFG_RELEASE_NUM" , & builder. version )
0 commit comments