@@ -1624,21 +1624,13 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
1624
1624
builder. tool_exe ( Tool :: RunMakeSupport ) ;
1625
1625
}
1626
1626
1627
- // Also provide `rust_test_helpers` for the host.
1628
- builder. ensure ( TestHelpers { target : compiler. host } ) ;
1629
-
1630
1627
// ensure that `libproc_macro` is available on the host.
1631
1628
if suite == "mir-opt" {
1632
1629
builder. ensure ( compile:: Std :: new ( compiler, compiler. host ) . is_for_mir_opt_tests ( true ) ) ;
1633
1630
} else {
1634
1631
builder. ensure ( compile:: Std :: new ( compiler, compiler. host ) ) ;
1635
1632
}
1636
1633
1637
- // As well as the target
1638
- if suite != "mir-opt" {
1639
- builder. ensure ( TestHelpers { target } ) ;
1640
- }
1641
-
1642
1634
let mut cmd = builder. tool_cmd ( Tool :: Compiletest ) ;
1643
1635
1644
1636
if suite == "mir-opt" {
@@ -1804,11 +1796,22 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
1804
1796
}
1805
1797
1806
1798
let mut hostflags = flags. clone ( ) ;
1807
- hostflags. push ( format ! ( "-Lnative={}" , builder. test_helpers_out( compiler. host) . display( ) ) ) ;
1808
1799
hostflags. extend ( linker_flags ( builder, compiler. host , LldThreads :: No , compiler. stage ) ) ;
1809
1800
1810
1801
let mut targetflags = flags;
1811
- targetflags. push ( format ! ( "-Lnative={}" , builder. test_helpers_out( target) . display( ) ) ) ;
1802
+
1803
+ // Provide `rust_test_helpers`. This is only used in `ui` tests.
1804
+ //
1805
+ // FIXME(jieyouxu): consider splitting `ui` tests into those that need `rust_test_helpers`
1806
+ // vs those that don't. Otherwise, e.g. when cross-ing to `wasm32-unknown-unknown` this
1807
+ // introduces annoyances.
1808
+ if suite == "ui" {
1809
+ builder. ensure ( TestHelpers { target : compiler. host } ) ;
1810
+ builder. ensure ( TestHelpers { target } ) ;
1811
+ hostflags
1812
+ . push ( format ! ( "-Lnative={}" , builder. test_helpers_out( compiler. host) . display( ) ) ) ;
1813
+ targetflags. push ( format ! ( "-Lnative={}" , builder. test_helpers_out( target) . display( ) ) ) ;
1814
+ }
1812
1815
1813
1816
for flag in hostflags {
1814
1817
cmd. arg ( "--host-rustcflags" ) . arg ( flag) ;
0 commit comments