@@ -3598,7 +3598,7 @@ impl<'test> TestCx<'test> {
3598
3598
} ;
3599
3599
3600
3600
// Calculate the paths of the recipe binary. As previously discussed, this is placed at
3601
- // `<base_dir>/<bin_name>` with `bin_name` being `rmake` or `rmake.exe` dependending on
3601
+ // `<base_dir>/<bin_name>` with `bin_name` being `rmake` or `rmake.exe` depending on
3602
3602
// platform.
3603
3603
let recipe_bin = {
3604
3604
let mut p = base_dir. join ( "rmake" ) ;
@@ -3611,7 +3611,6 @@ impl<'test> TestCx<'test> {
3611
3611
// FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
3612
3612
let mut rustc = Command :: new ( & self . config . rustc_path ) ;
3613
3613
rustc
3614
- // Specify output path
3615
3614
. arg ( "-o" )
3616
3615
. arg ( & recipe_bin)
3617
3616
// Specify library search paths for `run_make_support`.
@@ -3622,9 +3621,7 @@ impl<'test> TestCx<'test> {
3622
3621
// `extern run_make_support;`.
3623
3622
. arg ( "--extern" )
3624
3623
. arg ( format ! ( "run_make_support={}" , & support_lib_path. to_string_lossy( ) ) )
3625
- // Default to Edition 2021.
3626
3624
. arg ( "--edition=2021" )
3627
- // The recipe file itself.
3628
3625
. arg ( & self . testpaths . file . join ( "rmake.rs" ) )
3629
3626
// Provide necessary library search paths for rustc.
3630
3627
. env ( dylib_env_var ( ) , & env:: join_paths ( host_dylib_search_paths) . unwrap ( ) ) ;
@@ -3696,20 +3693,37 @@ impl<'test> TestCx<'test> {
3696
3693
3697
3694
// FIXME(jieyouxu): explain what the hecc we are doing here.
3698
3695
// FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
3696
+ // FIXME(jieyouxu): please rename `TARGET_RPATH_ENV`, `HOST_RPATH_DIR` and
3697
+ // `TARGET_RPATH_DIR`, it is **extremely** confusing!
3699
3698
let mut cmd = Command :: new ( & recipe_bin) ;
3700
3699
cmd. current_dir ( & rmake_out_dir)
3701
3700
. stdout ( Stdio :: piped ( ) )
3702
3701
. stderr ( Stdio :: piped ( ) )
3702
+ // Provide the target-specific env var that is used to record dylib search paths. For
3703
+ // example, this could be `LD_LIBRARY_PATH` on some linux distros but `PATH` on Windows.
3703
3704
. env ( "LD_LIB_PATH_ENVVAR" , dylib_env_var ( ) )
3704
- . env ( "TARGET_RPATH_ENV" , & env :: join_paths ( target_runtime_dylib_search_paths ) . unwrap ( ) )
3705
+ // Provide the dylib search paths.
3705
3706
. env ( dylib_env_var ( ) , & env:: join_paths ( recipe_dylib_search_paths) . unwrap ( ) )
3707
+ // Provide runtime dylib search paths.
3708
+ . env ( "TARGET_RPATH_ENV" , & env:: join_paths ( target_runtime_dylib_search_paths) . unwrap ( ) )
3709
+ // Provide the target.
3706
3710
. env ( "TARGET" , & self . config . target )
3711
+ // Some tests unfortunately still need Python, so provide path to a Python interpreter.
3707
3712
. env ( "PYTHON" , & self . config . python )
3713
+ // Provide path to checkout root. This is the top-level directory containing
3714
+ // rust-lang/rust checkout.
3708
3715
. env ( "SOURCE_ROOT" , & source_root)
3709
- . env ( "RUST_BUILD_STAGE" , & self . config . stage_id )
3716
+ // Provide path to stage-corresponding rustc.
3710
3717
. env ( "RUSTC" , & self . config . rustc_path )
3718
+ // Provide the directory to libraries that are needed to run the *compiler*. This is not
3719
+ // to be confused with `TARGET_RPATH_ENV` or `TARGET_RPATH_DIR`. This is needed if the
3720
+ // recipe wants to invoke rustc.
3711
3721
. env ( "HOST_RPATH_DIR" , & self . config . compile_lib_path )
3722
+ // Provide the directory to libraries that might be needed to run compiled binaries
3723
+ // (further compiled by the recipe!).
3712
3724
. env ( "TARGET_RPATH_DIR" , & self . config . run_lib_path )
3725
+ // Provide which LLVM components are available (e.g. which LLVM components are provided
3726
+ // through a specific CI runner).
3713
3727
. env ( "LLVM_COMPONENTS" , & self . config . llvm_components ) ;
3714
3728
3715
3729
if let Some ( ref rustdoc) = self . config . rustdoc_path {
0 commit comments