Skip to content

Commit 6ca3109

Browse files
committed
compiletest/rmake: improve stage explanation
1 parent 23f32f4 commit 6ca3109

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3489,7 +3489,6 @@ impl<'test> TestCx<'test> {
34893489
// `rmake_out/` directory.
34903490
//
34913491
// This setup intentionally diverges from legacy Makefile run-make tests.
3492-
// FIXME(jieyouxu): is there a better way to compute `base_dir`?
34933492
let base_dir = self.output_base_name();
34943493
if base_dir.exists() {
34953494
self.aggressive_rm_rf(&base_dir).unwrap();
@@ -3512,9 +3511,29 @@ impl<'test> TestCx<'test> {
35123511
}
35133512
}
35143513

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);
35183537
let stage = self.config.stage_id.split('-').next().unwrap();
35193538

35203539
// First, we construct the path to the built support library.

0 commit comments

Comments
 (0)