@@ -3489,7 +3489,6 @@ impl<'test> TestCx<'test> {
3489
3489
// `rmake_out/` directory.
3490
3490
//
3491
3491
// This setup intentionally diverges from legacy Makefile run-make tests.
3492
- // FIXME(jieyouxu): is there a better way to compute `base_dir`?
3493
3492
let base_dir = self . output_base_name ( ) ;
3494
3493
if base_dir. exists ( ) {
3495
3494
self . aggressive_rm_rf ( & base_dir) . unwrap ( ) ;
@@ -3512,9 +3511,29 @@ impl<'test> TestCx<'test> {
3512
3511
}
3513
3512
}
3514
3513
3515
- // FIXME(jieyouxu): is there a better way to get the stage number or otherwise compute the
3516
- // required stage-specific build directories?
3517
- // HACK: assume stageN-target, we only want stageN.
3514
+ // `self.config.stage_id` looks like `stage1-<target_tuplet>`, but we only want
3515
+ // the `stage1` part as that is what the output directories of bootstrap are prefixed with.
3516
+ // Note that this *assumes* build layout from bootstrap is produced as:
3517
+ //
3518
+ // ```
3519
+ // build/<target_tuplet>/ // <- this is `build_root`
3520
+ // ├── stage0
3521
+ // ├── stage0-bootstrap-tools
3522
+ // ├── stage0-codegen
3523
+ // ├── stage0-rustc
3524
+ // ├── stage0-std
3525
+ // ├── stage0-sysroot
3526
+ // ├── stage0-tools
3527
+ // ├── stage0-tools-bin
3528
+ // ├── stage1
3529
+ // ├── stage1-std
3530
+ // ├── stage1-tools
3531
+ // ├── stage1-tools-bin
3532
+ // └── test
3533
+ // ```
3534
+ // FIXME(jieyouxu): improve the communication between bootstrap and compiletest here so
3535
+ // we don't have to hack out a `stageN`.
3536
+ debug ! ( ?self . config. stage_id) ;
3518
3537
let stage = self . config . stage_id . split ( '-' ) . next ( ) . unwrap ( ) ;
3519
3538
3520
3539
// First, we construct the path to the built support library.
0 commit comments