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