@@ -3608,24 +3608,26 @@ impl<'test> TestCx<'test> {
3608
3608
// FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
3609
3609
let mut rustc = Command :: new ( & self . config . rustc_path ) ;
3610
3610
rustc
3611
+ // Specify output path
3611
3612
. arg ( "-o" )
3612
3613
. arg ( & recipe_bin)
3614
+ // Specify library search paths for `run_make_support`.
3613
3615
. arg ( format ! ( "-Ldependency={}" , & support_lib_path. parent( ) . unwrap( ) . to_string_lossy( ) ) )
3614
3616
. arg ( format ! ( "-Ldependency={}" , & support_lib_deps. to_string_lossy( ) ) )
3615
3617
. arg ( format ! ( "-Ldependency={}" , & support_lib_deps_deps. to_string_lossy( ) ) )
3618
+ // Provide `run_make_support` as extern prelude, so test writers don't need to write
3619
+ // `extern run_make_support;`.
3616
3620
. arg ( "--extern" )
3617
3621
. arg ( format ! ( "run_make_support={}" , & support_lib_path. to_string_lossy( ) ) )
3622
+ // Default to Edition 2021.
3618
3623
. arg ( "--edition=2021" )
3624
+ // Specify compilation target.
3625
+ . arg ( "--target" )
3626
+ . arg ( & self . config . target )
3627
+ // The recipe file itself.
3619
3628
. arg ( & self . testpaths . file . join ( "rmake.rs" ) )
3620
- . env ( "TARGET" , & self . config . target )
3621
- . env ( "PYTHON" , & self . config . python )
3622
- . env ( "RUST_BUILD_STAGE" , & self . config . stage_id )
3623
- . env ( "RUSTC" , & self . config . rustc_path )
3624
- . env ( "LD_LIB_PATH_ENVVAR" , dylib_env_var ( ) )
3625
- . env ( dylib_env_var ( ) , & env:: join_paths ( host_dylib_search_paths) . unwrap ( ) )
3626
- . env ( "HOST_RPATH_DIR" , & self . config . compile_lib_path )
3627
- . env ( "TARGET_RPATH_DIR" , & self . config . run_lib_path )
3628
- . env ( "LLVM_COMPONENTS" , & self . config . llvm_components ) ;
3629
+ // Provide necessary library search paths for rustc.
3630
+ . env ( dylib_env_var ( ) , & env:: join_paths ( host_dylib_search_paths) . unwrap ( ) ) ;
3629
3631
3630
3632
// In test code we want to be very pedantic about values being silently discarded that are
3631
3633
// annotated with `#[must_use]`.
0 commit comments