about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2024-07-19 09:10:58 +0000
committer许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2024-07-19 14:04:58 +0000
commit6ca31099e3cde3c91698e693c98dde84df225bd5 (patch)
tree307441c69724d005ae50a2006c95894f9d362296 /src
parent23f32f44ddda29bf469cb273d228c5dae384bde8 (diff)
downloadrust-6ca31099e3cde3c91698e693c98dde84df225bd5.tar.gz
rust-6ca31099e3cde3c91698e693c98dde84df225bd5.zip
compiletest/rmake: improve `stage` explanation
Diffstat (limited to 'src')
-rw-r--r--src/tools/compiletest/src/runtest.rs27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 5bc0ecd1fb4..c8fc84ef3fb 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -3489,7 +3489,6 @@ impl<'test> TestCx<'test> {
         // `rmake_out/` directory.
         //
         // This setup intentionally diverges from legacy Makefile run-make tests.
-        // FIXME(jieyouxu): is there a better way to compute `base_dir`?
         let base_dir = self.output_base_name();
         if base_dir.exists() {
             self.aggressive_rm_rf(&base_dir).unwrap();
@@ -3512,9 +3511,29 @@ impl<'test> TestCx<'test> {
             }
         }
 
-        // FIXME(jieyouxu): is there a better way to get the stage number or otherwise compute the
-        // required stage-specific build directories?
-        // HACK: assume stageN-target, we only want stageN.
+        // `self.config.stage_id` looks like `stage1-<target_tuplet>`, but we only want
+        // the `stage1` part as that is what the output directories of bootstrap are prefixed with.
+        // Note that this *assumes* build layout from bootstrap is produced as:
+        //
+        // ```
+        // build/<target_tuplet>/          // <- this is `build_root`
+        // ├── stage0
+        // ├── stage0-bootstrap-tools
+        // ├── stage0-codegen
+        // ├── stage0-rustc
+        // ├── stage0-std
+        // ├── stage0-sysroot
+        // ├── stage0-tools
+        // ├── stage0-tools-bin
+        // ├── stage1
+        // ├── stage1-std
+        // ├── stage1-tools
+        // ├── stage1-tools-bin
+        // └── test
+        // ```
+        // FIXME(jieyouxu): improve the communication between bootstrap and compiletest here so
+        // we don't have to hack out a `stageN`.
+        debug!(?self.config.stage_id);
         let stage = self.config.stage_id.split('-').next().unwrap();
 
         // First, we construct the path to the built support library.