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