@@ -1624,21 +1624,13 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
16241624 builder. tool_exe ( Tool :: RunMakeSupport ) ;
16251625 }
16261626
1627- // Also provide `rust_test_helpers` for the host.
1628- builder. ensure ( TestHelpers { target : compiler. host } ) ;
1629-
16301627 // ensure that `libproc_macro` is available on the host.
16311628 if suite == "mir-opt" {
16321629 builder. ensure ( compile:: Std :: new ( compiler, compiler. host ) . is_for_mir_opt_tests ( true ) ) ;
16331630 } else {
16341631 builder. ensure ( compile:: Std :: new ( compiler, compiler. host ) ) ;
16351632 }
16361633
1637- // As well as the target
1638- if suite != "mir-opt" {
1639- builder. ensure ( TestHelpers { target } ) ;
1640- }
1641-
16421634 let mut cmd = builder. tool_cmd ( Tool :: Compiletest ) ;
16431635
16441636 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
18041796 }
18051797
18061798 let mut hostflags = flags. clone ( ) ;
1807- hostflags. push ( format ! ( "-Lnative={}" , builder. test_helpers_out( compiler. host) . display( ) ) ) ;
18081799 hostflags. extend ( linker_flags ( builder, compiler. host , LldThreads :: No , compiler. stage ) ) ;
18091800
18101801 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+ }
18121815
18131816 for flag in hostflags {
18141817 cmd. arg ( "--host-rustcflags" ) . arg ( flag) ;
0 commit comments