@@ -3433,14 +3433,19 @@ impl<'test> TestCx<'test> {
3433
3433
3434
3434
fn run_rmake_v2_test ( & self ) {
3435
3435
// For `run-make` V2, we need to perform 2 steps to build and run a `run-make` V2 recipe
3436
- // (`rmake.rs`) to run the actual tests. The support library is already built as a tool
3437
- // dylib and is available under `build/$TARGET/stageN-tools-bin/librun_make_support.rlib`.
3436
+ // (`rmake.rs`) to run the actual tests. The support library is already built as a tool rust
3437
+ // library and is available under `build/$TARGET/stageN-tools-bin/librun_make_support.rlib`.
3438
3438
//
3439
- // 1. We need to build the recipe `rmake.rs` and link in the support library.
3440
- // 2. We need to run the recipe to build and run the tests.
3439
+ // 1. We need to build the recipe `rmake.rs` as a binary and link in the `run_make_support`
3440
+ // library.
3441
+ // 2. We need to run the recipe binary.
3442
+
3443
+ // FIXME(jieyouxu): hm, cwd doesn't look right here?
3441
3444
let cwd = env:: current_dir ( ) . unwrap ( ) ;
3445
+ // FIXME(jieyouxu): is there a better way to get `src_root`?
3442
3446
let src_root = self . config . src_base . parent ( ) . unwrap ( ) . parent ( ) . unwrap ( ) ;
3443
3447
let src_root = cwd. join ( & src_root) ;
3448
+ // FIXME(jieyouxu): is there a better way to get `build_root`?
3444
3449
let build_root = self . config . build_base . parent ( ) . unwrap ( ) . parent ( ) . unwrap ( ) ;
3445
3450
let build_root = cwd. join ( & build_root) ;
3446
3451
@@ -3450,11 +3455,13 @@ impl<'test> TestCx<'test> {
3450
3455
// rmake.exe
3451
3456
// rmake_out/
3452
3457
// ```
3453
- // having the executable separate from the output artifacts directory allows the recipes to
3454
- // `remove_dir_all($TMPDIR)` without running into permission denied issues because
3455
- // the executable is not under the `rmake_out/` directory.
3458
+ // having the recipe executable separate from the output artifacts directory allows the
3459
+ // recipes to `remove_dir_all($TMPDIR)` without running into issues related trying to remove
3460
+ // a currently running executable because the recipe executable is not under the
3461
+ // `rmake_out/` directory.
3456
3462
//
3457
3463
// This setup intentionally diverges from legacy Makefile run-make tests.
3464
+ // FIXME(jieyouxu): is there a better way to compute `base_dir`?
3458
3465
let base_dir = cwd. join ( self . output_base_name ( ) ) ;
3459
3466
if base_dir. exists ( ) {
3460
3467
self . aggressive_rm_rf ( & base_dir) . unwrap ( ) ;
@@ -3477,10 +3484,13 @@ impl<'test> TestCx<'test> {
3477
3484
}
3478
3485
}
3479
3486
3487
+ // FIXME(jieyouxu): is there a better way to get the stage number or otherwise compute the
3488
+ // required stage-specific build directories?
3480
3489
// HACK: assume stageN-target, we only want stageN.
3481
3490
let stage = self . config . stage_id . split ( '-' ) . next ( ) . unwrap ( ) ;
3482
3491
3483
3492
// First, we construct the path to the built support library.
3493
+ // FIXME(jieyouxu): explain what the hecc we are doing here.
3484
3494
let mut support_lib_path = PathBuf :: new ( ) ;
3485
3495
support_lib_path. push ( & build_root) ;
3486
3496
support_lib_path. push ( format ! ( "{}-tools-bin" , stage) ) ;
@@ -3492,19 +3502,22 @@ impl<'test> TestCx<'test> {
3492
3502
stage_std_path. push ( "lib" ) ;
3493
3503
3494
3504
// Then, we need to build the recipe `rmake.rs` and link in the support library.
3505
+ // FIXME(jieyouxu): use `std::env::consts::EXE_EXTENSION`.
3495
3506
let recipe_bin = base_dir. join ( if self . config . target . contains ( "windows" ) {
3496
3507
"rmake.exe"
3497
3508
} else {
3498
3509
"rmake"
3499
3510
} ) ;
3500
3511
3512
+ // FIXME(jieyouxu): explain what the hecc we are doing here.
3501
3513
let mut support_lib_deps = PathBuf :: new ( ) ;
3502
3514
support_lib_deps. push ( & build_root) ;
3503
3515
support_lib_deps. push ( format ! ( "{}-tools" , stage) ) ;
3504
3516
support_lib_deps. push ( & self . config . host ) ;
3505
3517
support_lib_deps. push ( "release" ) ;
3506
3518
support_lib_deps. push ( "deps" ) ;
3507
3519
3520
+ // FIXME(jieyouxu): explain what the hecc we are doing here.
3508
3521
let mut support_lib_deps_deps = PathBuf :: new ( ) ;
3509
3522
support_lib_deps_deps. push ( & build_root) ;
3510
3523
support_lib_deps_deps. push ( format ! ( "{}-tools" , stage) ) ;
@@ -3514,6 +3527,7 @@ impl<'test> TestCx<'test> {
3514
3527
debug ! ( ?support_lib_deps) ;
3515
3528
debug ! ( ?support_lib_deps_deps) ;
3516
3529
3530
+ // FIXME(jieyouxu): explain what the hecc we are doing here.
3517
3531
let orig_dylib_env_paths =
3518
3532
Vec :: from_iter ( env:: split_paths ( & env:: var ( dylib_env_var ( ) ) . unwrap ( ) ) ) ;
3519
3533
@@ -3522,6 +3536,8 @@ impl<'test> TestCx<'test> {
3522
3536
host_dylib_env_paths. extend ( orig_dylib_env_paths. iter ( ) . cloned ( ) ) ;
3523
3537
let host_dylib_env_paths = env:: join_paths ( host_dylib_env_paths) . unwrap ( ) ;
3524
3538
3539
+ // FIXME(jieyouxu): explain what the hecc we are doing here.
3540
+ // FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
3525
3541
let mut cmd = Command :: new ( & self . config . rustc_path ) ;
3526
3542
cmd. arg ( "-o" )
3527
3543
. arg ( & recipe_bin)
@@ -3563,16 +3579,20 @@ impl<'test> TestCx<'test> {
3563
3579
// Finally, we need to run the recipe binary to build and run the actual tests.
3564
3580
debug ! ( ?recipe_bin) ;
3565
3581
3582
+ // FIXME(jieyouxu): explain what the hecc we are doing here.
3566
3583
let mut dylib_env_paths = orig_dylib_env_paths. clone ( ) ;
3567
3584
dylib_env_paths. push ( support_lib_path. parent ( ) . unwrap ( ) . to_path_buf ( ) ) ;
3568
3585
dylib_env_paths. push ( stage_std_path. join ( "rustlib" ) . join ( & self . config . host ) . join ( "lib" ) ) ;
3569
3586
let dylib_env_paths = env:: join_paths ( dylib_env_paths) . unwrap ( ) ;
3570
3587
3588
+ // FIXME(jieyouxu): explain what the hecc we are doing here.
3571
3589
let mut target_rpath_env_path = Vec :: new ( ) ;
3572
3590
target_rpath_env_path. push ( & rmake_out_dir) ;
3573
3591
target_rpath_env_path. extend ( & orig_dylib_env_paths) ;
3574
3592
let target_rpath_env_path = env:: join_paths ( target_rpath_env_path) . unwrap ( ) ;
3575
3593
3594
+ // FIXME(jieyouxu): explain what the hecc we are doing here.
3595
+ // FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
3576
3596
let mut cmd = Command :: new ( & recipe_bin) ;
3577
3597
cmd. current_dir ( & rmake_out_dir)
3578
3598
. stdout ( Stdio :: piped ( ) )
0 commit comments