@@ -3696,20 +3696,37 @@ impl<'test> TestCx<'test> {
3696
3696
3697
3697
// FIXME(jieyouxu): explain what the hecc we are doing here.
3698
3698
// FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
3699
+ // FIXME(jieyouxu): please rename `TARGET_RPATH_ENV`, `HOST_RPATH_DIR` and
3700
+ // `TARGET_RPATH_DIR`, it is **extremely** confusing!
3699
3701
let mut cmd = Command :: new ( & recipe_bin) ;
3700
3702
cmd. current_dir ( & rmake_out_dir)
3701
3703
. stdout ( Stdio :: piped ( ) )
3702
3704
. stderr ( Stdio :: piped ( ) )
3705
+ // Provide the target-specific env var that is used to record dylib search paths. For
3706
+ // example, this could be `LD_LIBRARY_PATH` on some linux distros but `PATH` on Windows.
3703
3707
. env ( "LD_LIB_PATH_ENVVAR" , dylib_env_var ( ) )
3704
- . env ( "TARGET_RPATH_ENV" , & env :: join_paths ( target_runtime_dylib_search_paths ) . unwrap ( ) )
3708
+ // Provide the dylib search paths.
3705
3709
. env ( dylib_env_var ( ) , & env:: join_paths ( recipe_dylib_search_paths) . unwrap ( ) )
3710
+ // Provide runtime dylib search paths.
3711
+ . env ( "TARGET_RPATH_ENV" , & env:: join_paths ( target_runtime_dylib_search_paths) . unwrap ( ) )
3712
+ // Provide the target.
3706
3713
. env ( "TARGET" , & self . config . target )
3714
+ // Some tests unfortunately still need Python, so provide path to a Python interpreter.
3707
3715
. env ( "PYTHON" , & self . config . python )
3716
+ // Provide path to checkout root. This is the top-level directory containing
3717
+ // rust-lang/rust checkout.
3708
3718
. env ( "SOURCE_ROOT" , & source_root)
3709
- . env ( "RUST_BUILD_STAGE" , & self . config . stage_id )
3719
+ // Provide path to stage-corresponding rustc.
3710
3720
. env ( "RUSTC" , & self . config . rustc_path )
3721
+ // Provide the directory to libraries that are needed to run the *compiler*. This is not
3722
+ // to be confused with `TARGET_RPATH_ENV` or `TARGET_RPATH_DIR`. This is needed if the
3723
+ // recipe wants to invoke rustc.
3711
3724
. env ( "HOST_RPATH_DIR" , & self . config . compile_lib_path )
3725
+ // Provide the directory to libraries that might be needed to run compiled binaries
3726
+ // (further compiled by the recipe!).
3712
3727
. env ( "TARGET_RPATH_DIR" , & self . config . run_lib_path )
3728
+ // Provide which LLVM components are available (e.g. which LLVM components are provided
3729
+ // through a specific CI runner).
3713
3730
. env ( "LLVM_COMPONENTS" , & self . config . llvm_components ) ;
3714
3731
3715
3732
if let Some ( ref rustdoc) = self . config . rustdoc_path {
0 commit comments