@@ -1079,7 +1079,7 @@ impl Step for RustdocJSNotStd {
1079
1079
1080
1080
fn run ( self , builder : & Builder < ' _ > ) {
1081
1081
builder. ensure ( Compiletest {
1082
- compiler : self . compiler ,
1082
+ test_compiler : self . compiler ,
1083
1083
target : self . target ,
1084
1084
mode : "rustdoc-js" ,
1085
1085
suite : "rustdoc-js" ,
@@ -1437,8 +1437,8 @@ macro_rules! test {
1437
1437
$( #[ $attr] ) *
1438
1438
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1439
1439
pub struct $name {
1440
- pub compiler : Compiler ,
1441
- pub target: TargetSelection ,
1440
+ test_compiler : Compiler ,
1441
+ target: TargetSelection ,
1442
1442
}
1443
1443
1444
1444
impl Step for $name {
@@ -1456,14 +1456,14 @@ macro_rules! test {
1456
1456
}
1457
1457
1458
1458
fn make_run( run: RunConfig <' _>) {
1459
- let compiler = run. builder. compiler( run. builder. top_stage, run. build_triple( ) ) ;
1459
+ let test_compiler = run. builder. compiler( run. builder. top_stage, run. build_triple( ) ) ;
1460
1460
1461
- run. builder. ensure( $name { compiler , target: run. target } ) ;
1461
+ run. builder. ensure( $name { test_compiler , target: run. target } ) ;
1462
1462
}
1463
1463
1464
1464
fn run( self , builder: & Builder <' _>) {
1465
1465
builder. ensure( Compiletest {
1466
- compiler : self . compiler ,
1466
+ test_compiler : self . test_compiler ,
1467
1467
target: self . target,
1468
1468
mode: $mode,
1469
1469
suite: $suite,
@@ -1644,7 +1644,7 @@ impl Step for Coverage {
1644
1644
// Like other compiletest suite test steps, delegate to an internal
1645
1645
// compiletest task to actually run the tests.
1646
1646
builder. ensure ( Compiletest {
1647
- compiler,
1647
+ test_compiler : compiler,
1648
1648
target,
1649
1649
mode,
1650
1650
suite : Self :: SUITE ,
@@ -1685,7 +1685,7 @@ impl Step for MirOpt {
1685
1685
fn run ( self , builder : & Builder < ' _ > ) {
1686
1686
let run = |target| {
1687
1687
builder. ensure ( Compiletest {
1688
- compiler : self . compiler ,
1688
+ test_compiler : self . compiler ,
1689
1689
target,
1690
1690
mode : "mir-opt" ,
1691
1691
suite : "mir-opt" ,
@@ -1720,9 +1720,15 @@ impl Step for MirOpt {
1720
1720
}
1721
1721
}
1722
1722
1723
+ /// Executes the `compiletest` tool to run a suite of tests.
1724
+ ///
1725
+ /// Compiles all tests with `test_compiler` for `target` with the specified
1726
+ /// compiletest `mode` and `suite` arguments. For example `mode` can be
1727
+ /// "run-pass" or `suite` can be something like `debuginfo`.
1723
1728
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1724
1729
struct Compiletest {
1725
- compiler : Compiler ,
1730
+ /// The compiler that we're testing.
1731
+ test_compiler : Compiler ,
1726
1732
target : TargetSelection ,
1727
1733
mode : & ' static str ,
1728
1734
suite : & ' static str ,
@@ -1737,11 +1743,6 @@ impl Step for Compiletest {
1737
1743
run. never ( )
1738
1744
}
1739
1745
1740
- /// Executes the `compiletest` tool to run a suite of tests.
1741
- ///
1742
- /// Compiles all tests with `compiler` for `target` with the specified
1743
- /// compiletest `mode` and `suite` arguments. For example `mode` can be
1744
- /// "run-pass" or `suite` can be something like `debuginfo`.
1745
1746
fn run ( self , builder : & Builder < ' _ > ) {
1746
1747
if builder. doc_tests == DocTests :: Only {
1747
1748
return ;
@@ -1756,7 +1757,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
1756
1757
crate :: exit!( 1 ) ;
1757
1758
}
1758
1759
1759
- let mut compiler = self . compiler ;
1760
+ let mut test_compiler = self . test_compiler ;
1760
1761
let target = self . target ;
1761
1762
let mode = self . mode ;
1762
1763
let suite = self . suite ;
@@ -1776,30 +1777,30 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
1776
1777
// NOTE: Only stage 1 is special cased because we need the rustc_private artifacts to match the
1777
1778
// running compiler in stage 2 when plugins run.
1778
1779
let query_compiler;
1779
- let ( stage, stage_id) = if suite == "ui-fulldeps" && compiler . stage == 1 {
1780
+ let ( stage, stage_id) = if suite == "ui-fulldeps" && test_compiler . stage == 1 {
1780
1781
// Even when using the stage 0 compiler, we also need to provide the stage 1 compiler
1781
1782
// so that compiletest can query it for target information.
1782
- query_compiler = Some ( compiler ) ;
1783
+ query_compiler = Some ( test_compiler ) ;
1783
1784
// At stage 0 (stage - 1) we are using the stage0 compiler. Using `self.target` can lead
1784
1785
// finding an incorrect compiler path on cross-targets, as the stage 0 is always equal to
1785
1786
// `build.build` in the configuration.
1786
1787
let build = builder. build . host_target ;
1787
- compiler = builder. compiler ( compiler . stage - 1 , build) ;
1788
- let test_stage = compiler . stage + 1 ;
1788
+ test_compiler = builder. compiler ( test_compiler . stage - 1 , build) ;
1789
+ let test_stage = test_compiler . stage + 1 ;
1789
1790
( test_stage, format ! ( "stage{test_stage}-{build}" ) )
1790
1791
} else {
1791
1792
query_compiler = None ;
1792
- let stage = compiler . stage ;
1793
+ let stage = test_compiler . stage ;
1793
1794
( stage, format ! ( "stage{stage}-{target}" ) )
1794
1795
} ;
1795
1796
1796
1797
if suite. ends_with ( "fulldeps" ) {
1797
- builder. ensure ( compile:: Rustc :: new ( compiler , target) ) ;
1798
+ builder. ensure ( compile:: Rustc :: new ( test_compiler , target) ) ;
1798
1799
}
1799
1800
1800
1801
if suite == "debuginfo" {
1801
1802
builder. ensure ( dist:: DebuggerScripts {
1802
- sysroot : builder. sysroot ( compiler ) . to_path_buf ( ) ,
1803
+ sysroot : builder. sysroot ( test_compiler ) . to_path_buf ( ) ,
1803
1804
target,
1804
1805
} ) ;
1805
1806
}
@@ -1809,30 +1810,32 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
1809
1810
1810
1811
// ensure that `libproc_macro` is available on the host.
1811
1812
if suite == "mir-opt" {
1812
- builder. ensure ( compile:: Std :: new ( compiler, compiler. host ) . is_for_mir_opt_tests ( true ) ) ;
1813
+ builder. ensure (
1814
+ compile:: Std :: new ( test_compiler, test_compiler. host ) . is_for_mir_opt_tests ( true ) ,
1815
+ ) ;
1813
1816
} else {
1814
- builder. std ( compiler , compiler . host ) ;
1817
+ builder. std ( test_compiler , test_compiler . host ) ;
1815
1818
}
1816
1819
1817
1820
let mut cmd = builder. tool_cmd ( Tool :: Compiletest ) ;
1818
1821
1819
1822
if suite == "mir-opt" {
1820
- builder. ensure ( compile:: Std :: new ( compiler , target) . is_for_mir_opt_tests ( true ) ) ;
1823
+ builder. ensure ( compile:: Std :: new ( test_compiler , target) . is_for_mir_opt_tests ( true ) ) ;
1821
1824
} else {
1822
- builder. std ( compiler , target) ;
1825
+ builder. std ( test_compiler , target) ;
1823
1826
}
1824
1827
1825
- builder. ensure ( RemoteCopyLibs { build_compiler : compiler , target } ) ;
1828
+ builder. ensure ( RemoteCopyLibs { build_compiler : test_compiler , target } ) ;
1826
1829
1827
1830
// compiletest currently has... a lot of arguments, so let's just pass all
1828
1831
// of them!
1829
1832
1830
1833
cmd. arg ( "--stage" ) . arg ( stage. to_string ( ) ) ;
1831
1834
cmd. arg ( "--stage-id" ) . arg ( stage_id) ;
1832
1835
1833
- cmd. arg ( "--compile-lib-path" ) . arg ( builder. rustc_libdir ( compiler ) ) ;
1834
- cmd. arg ( "--run-lib-path" ) . arg ( builder. sysroot_target_libdir ( compiler , target) ) ;
1835
- cmd. arg ( "--rustc-path" ) . arg ( builder. rustc ( compiler ) ) ;
1836
+ cmd. arg ( "--compile-lib-path" ) . arg ( builder. rustc_libdir ( test_compiler ) ) ;
1837
+ cmd. arg ( "--run-lib-path" ) . arg ( builder. sysroot_target_libdir ( test_compiler , target) ) ;
1838
+ cmd. arg ( "--rustc-path" ) . arg ( builder. rustc ( test_compiler ) ) ;
1836
1839
if let Some ( query_compiler) = query_compiler {
1837
1840
cmd. arg ( "--query-rustc-path" ) . arg ( builder. rustc ( query_compiler) ) ;
1838
1841
}
@@ -1849,14 +1852,16 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
1849
1852
// If we're using `--stage 0`, we should provide the bootstrap cargo.
1850
1853
builder. initial_cargo . clone ( )
1851
1854
} else {
1852
- builder. ensure ( tool:: Cargo :: from_build_compiler ( compiler, compiler. host ) ) . tool_path
1855
+ builder
1856
+ . ensure ( tool:: Cargo :: from_build_compiler ( test_compiler, test_compiler. host ) )
1857
+ . tool_path
1853
1858
} ;
1854
1859
1855
1860
cmd. arg ( "--cargo-path" ) . arg ( cargo_path) ;
1856
1861
1857
1862
// We need to pass the compiler that was used to compile run-make-support,
1858
1863
// because we have to use the same compiler to compile rmake.rs recipes.
1859
- let stage0_rustc_path = builder. compiler ( 0 , compiler . host ) ;
1864
+ let stage0_rustc_path = builder. compiler ( 0 , test_compiler . host ) ;
1860
1865
cmd. arg ( "--stage0-rustc-path" ) . arg ( builder. rustc ( stage0_rustc_path) ) ;
1861
1866
}
1862
1867
@@ -1868,7 +1873,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
1868
1873
|| mode == "rustdoc-json"
1869
1874
|| suite == "coverage-run-rustdoc"
1870
1875
{
1871
- cmd. arg ( "--rustdoc-path" ) . arg ( builder. rustdoc_for_compiler ( compiler ) ) ;
1876
+ cmd. arg ( "--rustdoc-path" ) . arg ( builder. rustdoc_for_compiler ( test_compiler ) ) ;
1872
1877
}
1873
1878
1874
1879
if mode == "rustdoc-json" {
@@ -1893,26 +1898,26 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
1893
1898
// directory immediately under the root build directory, and the test-suite-specific build
1894
1899
// directory.
1895
1900
cmd. arg ( "--build-root" ) . arg ( & builder. out ) ;
1896
- cmd. arg ( "--build-test-suite-root" ) . arg ( testdir ( builder, compiler . host ) . join ( suite) ) ;
1901
+ cmd. arg ( "--build-test-suite-root" ) . arg ( testdir ( builder, test_compiler . host ) . join ( suite) ) ;
1897
1902
1898
1903
// When top stage is 0, that means that we're testing an externally provided compiler.
1899
1904
// In that case we need to use its specific sysroot for tests to pass.
1900
1905
let sysroot = if builder. top_stage == 0 {
1901
1906
builder. initial_sysroot . clone ( )
1902
1907
} else {
1903
- builder. sysroot ( compiler )
1908
+ builder. sysroot ( test_compiler )
1904
1909
} ;
1905
1910
1906
1911
cmd. arg ( "--sysroot-base" ) . arg ( sysroot) ;
1907
1912
1908
1913
cmd. arg ( "--suite" ) . arg ( suite) ;
1909
1914
cmd. arg ( "--mode" ) . arg ( mode) ;
1910
1915
cmd. arg ( "--target" ) . arg ( target. rustc_target_arg ( ) ) ;
1911
- cmd. arg ( "--host" ) . arg ( & * compiler . host . triple ) ;
1916
+ cmd. arg ( "--host" ) . arg ( & * test_compiler . host . triple ) ;
1912
1917
cmd. arg ( "--llvm-filecheck" ) . arg ( builder. llvm_filecheck ( builder. config . host_target ) ) ;
1913
1918
1914
1919
if let Some ( codegen_backend) = builder. config . cmd . test_codegen_backend ( ) {
1915
- if !builder. config . enabled_codegen_backends ( compiler . host ) . contains ( codegen_backend) {
1920
+ if !builder. config . enabled_codegen_backends ( test_compiler . host ) . contains ( codegen_backend) {
1916
1921
eprintln ! (
1917
1922
"\
1918
1923
ERROR: No configured backend named `{name}`
@@ -1931,7 +1936,7 @@ HELP: You can add it into `bootstrap.toml` in `rust.codegen-backends = [{name:?}
1931
1936
// Tells compiletest which codegen backend to use.
1932
1937
// It is used to e.g. ignore tests that don't support that codegen backend.
1933
1938
cmd. arg ( "--default-codegen-backend" )
1934
- . arg ( builder. config . default_codegen_backend ( compiler . host ) . name ( ) ) ;
1939
+ . arg ( builder. config . default_codegen_backend ( test_compiler . host ) . name ( ) ) ;
1935
1940
}
1936
1941
1937
1942
if builder. build . config . llvm_enzyme {
@@ -2011,7 +2016,7 @@ HELP: You can add it into `bootstrap.toml` in `rust.codegen-backends = [{name:?}
2011
2016
if let Some ( linker) = builder. linker ( target) {
2012
2017
cmd. arg ( "--target-linker" ) . arg ( linker) ;
2013
2018
}
2014
- if let Some ( linker) = builder. linker ( compiler . host ) {
2019
+ if let Some ( linker) = builder. linker ( test_compiler . host ) {
2015
2020
cmd. arg ( "--host-linker" ) . arg ( linker) ;
2016
2021
}
2017
2022
}
@@ -2022,16 +2027,18 @@ HELP: You can add it into `bootstrap.toml` in `rust.codegen-backends = [{name:?}
2022
2027
}
2023
2028
2024
2029
let mut hostflags = flags. clone ( ) ;
2025
- hostflags. extend ( linker_flags ( builder, compiler . host , LldThreads :: No ) ) ;
2030
+ hostflags. extend ( linker_flags ( builder, test_compiler . host , LldThreads :: No ) ) ;
2026
2031
2027
2032
let mut targetflags = flags;
2028
2033
2029
2034
// Provide `rust_test_helpers` for both host and target.
2030
2035
if suite == "ui" || suite == "incremental" {
2031
- builder. ensure ( TestHelpers { target : compiler . host } ) ;
2036
+ builder. ensure ( TestHelpers { target : test_compiler . host } ) ;
2032
2037
builder. ensure ( TestHelpers { target } ) ;
2033
- hostflags
2034
- . push ( format ! ( "-Lnative={}" , builder. test_helpers_out( compiler. host) . display( ) ) ) ;
2038
+ hostflags. push ( format ! (
2039
+ "-Lnative={}" ,
2040
+ builder. test_helpers_out( test_compiler. host) . display( )
2041
+ ) ) ;
2035
2042
targetflags. push ( format ! ( "-Lnative={}" , builder. test_helpers_out( target) . display( ) ) ) ;
2036
2043
}
2037
2044
@@ -2116,7 +2123,7 @@ HELP: You can add it into `bootstrap.toml` in `rust.codegen-backends = [{name:?}
2116
2123
2117
2124
let mut llvm_components_passed = false ;
2118
2125
let mut copts_passed = false ;
2119
- if builder. config . llvm_enabled ( compiler . host ) {
2126
+ if builder. config . llvm_enabled ( test_compiler . host ) {
2120
2127
let llvm:: LlvmResult { host_llvm_config, .. } =
2121
2128
builder. ensure ( llvm:: Llvm { target : builder. config . host_target } ) ;
2122
2129
if !builder. config . dry_run ( ) {
@@ -2327,7 +2334,7 @@ HELP: You can add it into `bootstrap.toml` in `rust.codegen-backends = [{name:?}
2327
2334
format ! ( "compiletest suite={suite} mode={mode}" ) ,
2328
2335
// FIXME: compiletest sometimes behaves as ToolStd, we could expose that difference here
2329
2336
Mode :: ToolBootstrap ,
2330
- compiler ,
2337
+ test_compiler ,
2331
2338
target,
2332
2339
) ;
2333
2340
try_run_tests ( builder, & mut cmd, false ) ;
@@ -2350,7 +2357,7 @@ HELP: You can add it into `bootstrap.toml` in `rust.codegen-backends = [{name:?}
2350
2357
2351
2358
builder. info ( & format ! (
2352
2359
"Check compiletest suite={} mode={} compare_mode={} ({} -> {})" ,
2353
- suite, mode, compare_mode, & compiler . host, target
2360
+ suite, mode, compare_mode, & test_compiler . host, target
2354
2361
) ) ;
2355
2362
let _time = helpers:: timeit ( builder) ;
2356
2363
try_run_tests ( builder, & mut cmd, false ) ;
@@ -2360,7 +2367,7 @@ HELP: You can add it into `bootstrap.toml` in `rust.codegen-backends = [{name:?}
2360
2367
fn metadata ( & self ) -> Option < StepMetadata > {
2361
2368
Some (
2362
2369
StepMetadata :: test ( & format ! ( "compiletest-{}" , self . suite) , self . target )
2363
- . stage ( self . compiler . stage ) ,
2370
+ . stage ( self . test_compiler . stage ) ,
2364
2371
)
2365
2372
}
2366
2373
}
0 commit comments