@@ -3659,27 +3659,35 @@ impl<'test> TestCx<'test> {
3659
3659
rustc. arg ( "--sysroot" ) . arg ( & stage0_sysroot) ;
3660
3660
}
3661
3661
3662
+ // Now run rustc to build the recipe.
3662
3663
let res = self . run_command_to_procres ( & mut rustc) ;
3663
3664
if !res. status . success ( ) {
3664
3665
self . fatal_proc_rec ( "run-make test failed: could not build `rmake.rs` recipe" , & res) ;
3665
3666
}
3666
3667
3667
- // FIXME(jieyouxu): explain what the hecc we are doing here.
3668
- let mut stage_std_path = PathBuf :: new ( ) ;
3669
- stage_std_path. push ( & build_root) ;
3670
- stage_std_path. push ( & stage) ;
3671
- stage_std_path. push ( "lib" ) ;
3668
+ // To actually run the recipe, we have to provide the recipe with a bunch of information
3669
+ // provided through env vars.
3672
3670
3673
- // FIXME(jieyouxu): explain what the hecc we are doing here.
3671
+ // Compute stage-specific standard library paths.
3672
+ let stage_std_path = {
3673
+ let mut p = build_root. clone ( ) ;
3674
+ p. push ( & stage) ;
3675
+ p. push ( "lib" ) ;
3676
+ p
3677
+ } ;
3678
+ debug ! ( ?stage_std_path) ;
3679
+
3680
+ // Compute dynamic library search paths for recipes.
3674
3681
let recipe_dylib_search_paths = {
3675
3682
let mut paths = base_dylib_search_paths. clone ( ) ;
3676
3683
paths. push ( support_lib_path. parent ( ) . unwrap ( ) . to_path_buf ( ) ) ;
3677
3684
paths. push ( stage_std_path. join ( "rustlib" ) . join ( & self . config . host ) . join ( "lib" ) ) ;
3678
3685
paths
3679
3686
} ;
3687
+ debug ! ( ?recipe_dylib_search_paths) ;
3680
3688
3681
- // FIXME(jieyouxu): explain what the hecc we are doing here .
3682
- let target_rpaths = {
3689
+ // Compute runtime library search paths for recipes. This is target-specific .
3690
+ let target_runtime_dylib_search_paths = {
3683
3691
let mut paths = vec ! [ rmake_out_dir. clone( ) ] ;
3684
3692
paths. extend ( base_dylib_search_paths. iter ( ) . cloned ( ) ) ;
3685
3693
paths
@@ -3692,7 +3700,7 @@ impl<'test> TestCx<'test> {
3692
3700
. stdout ( Stdio :: piped ( ) )
3693
3701
. stderr ( Stdio :: piped ( ) )
3694
3702
. env ( "LD_LIB_PATH_ENVVAR" , dylib_env_var ( ) )
3695
- . env ( "TARGET_RPATH_ENV" , & env:: join_paths ( target_rpaths ) . unwrap ( ) )
3703
+ . env ( "TARGET_RPATH_ENV" , & env:: join_paths ( target_runtime_dylib_search_paths ) . unwrap ( ) )
3696
3704
. env ( dylib_env_var ( ) , & env:: join_paths ( recipe_dylib_search_paths) . unwrap ( ) )
3697
3705
. env ( "TARGET" , & self . config . target )
3698
3706
. env ( "PYTHON" , & self . config . python )
0 commit comments