Skip to content

Commit c863525

Browse files
committed
compiletest/rmake: improve comments
1 parent 3e77f7c commit c863525

File tree

1 file changed

+7
-30
lines changed

1 file changed

+7
-30
lines changed

src/tools/compiletest/src/runtest.rs

+7-30
Original file line numberDiff line numberDiff line change
@@ -3440,17 +3440,8 @@ impl<'test> TestCx<'test> {
34403440
// library.
34413441
// 2. We need to run the recipe binary.
34423442

3443-
// FIXME(jieyouxu): path examples
3444-
// source_root="/home/gh-jieyouxu/rust"
3445-
// src_root="/home/gh-jieyouxu/rust"
3446-
// build_root="/home/gh-jieyouxu/rust/build/aarch64-unknown-linux-gnu"
3447-
// self.config.build_base="/home/gh-jieyouxu/rust/build/aarch64-unknown-linux-gnu/test/run-make"
3448-
// support_lib_deps="/home/gh-jieyouxu/rust/build/aarch64-unknown-linux-gnu/stage1-tools/aarch64-unknown-linux-gnu/release/deps"
3449-
// support_lib_deps_deps="/home/gh-jieyouxu/rust/build/aarch64-unknown-linux-gnu/stage1-tools/release/deps"
3450-
// recipe_bin="/home/gh-jieyouxu/rust/build/aarch64-unknown-linux-gnu/test/run-make/a-b-a-linker-guard/a-b-a-linker-guard/rmake"
3451-
3452-
// So we assume the rust-lang/rust project setup looks like (our `.` is the top-level
3453-
// directory, irrelevant entries to our purposes omitted):
3443+
// So we assume the rust-lang/rust project setup looks like the following (our `.` is the
3444+
// top-level directory, irrelevant entries to our purposes omitted):
34543445
//
34553446
// ```
34563447
// . // <- `source_root`
@@ -3467,15 +3458,12 @@ impl<'test> TestCx<'test> {
34673458
// `source_root` is the top-level directory containing the rust-lang/rust checkout.
34683459
let source_root =
34693460
self.config.find_rust_src_root().expect("could not determine rust source root");
3470-
debug!(?source_root);
34713461
// `self.config.build_base` is actually the build base folder + "test" + test suite name, it
3472-
// looks like `build/<host_tuplet>/test/run-make`. But we want `build/<host_tuplet>/`. Note
3462+
// looks like `build/<host_triple>/test/run-make`. But we want `build/<host_triple>/`. Note
34733463
// that the `build` directory does not need to be called `build`, nor does it need to be
34743464
// under `source_root`, so we must compute it based off of `self.config.build_base`.
3475-
debug!(?self.config.build_base);
34763465
let build_root =
34773466
self.config.build_base.parent().and_then(Path::parent).unwrap().to_path_buf();
3478-
debug!(?build_root);
34793467

34803468
// We construct the following directory tree for each rmake.rs test:
34813469
// ```
@@ -3511,12 +3499,12 @@ impl<'test> TestCx<'test> {
35113499
}
35123500
}
35133501

3514-
// `self.config.stage_id` looks like `stage1-<target_tuplet>`, but we only want
3502+
// `self.config.stage_id` looks like `stage1-<target_triple>`, but we only want
35153503
// the `stage1` part as that is what the output directories of bootstrap are prefixed with.
35163504
// Note that this *assumes* build layout from bootstrap is produced as:
35173505
//
35183506
// ```
3519-
// build/<target_tuplet>/ // <- this is `build_root`
3507+
// build/<target_triple>/ // <- this is `build_root`
35203508
// ├── stage0
35213509
// ├── stage0-bootstrap-tools
35223510
// ├── stage0-codegen
@@ -3533,7 +3521,6 @@ impl<'test> TestCx<'test> {
35333521
// ```
35343522
// FIXME(jieyouxu): improve the communication between bootstrap and compiletest here so
35353523
// we don't have to hack out a `stageN`.
3536-
debug!(?self.config.stage_id);
35373524
let stage = self.config.stage_id.split('-').next().unwrap();
35383525

35393526
// In order to link in the support library as a rlib when compiling recipes, we need three
@@ -3545,12 +3532,12 @@ impl<'test> TestCx<'test> {
35453532
// The paths look like
35463533
//
35473534
// ```
3548-
// build/<target_tuplet>/
3535+
// build/<target_triple>/
35493536
// ├── stageN-tools-bin/
35503537
// │ └── librun_make_support.rlib // <- support rlib itself
35513538
// ├── stageN-tools/
35523539
// │ ├── release/deps/ // <- deps of deps
3553-
// │ └── <host_tuplet>/release/deps/ // <- deps
3540+
// │ └── <host_triple>/release/deps/ // <- deps
35543541
// ```
35553542
//
35563543
// There almost certainly is a better way to do this, but this seems to work for now.
@@ -3561,7 +3548,6 @@ impl<'test> TestCx<'test> {
35613548
p.push("librun_make_support.rlib");
35623549
p
35633550
};
3564-
debug!(?support_lib_path);
35653551

35663552
let support_lib_deps = {
35673553
let mut p = build_root.clone();
@@ -3571,7 +3557,6 @@ impl<'test> TestCx<'test> {
35713557
p.push("deps");
35723558
p
35733559
};
3574-
debug!(?support_lib_deps);
35753560

35763561
let support_lib_deps_deps = {
35773562
let mut p = build_root.clone();
@@ -3580,7 +3565,6 @@ impl<'test> TestCx<'test> {
35803565
p.push("deps");
35813566
p
35823567
};
3583-
debug!(?support_lib_deps_deps);
35843568

35853569
// To compile the recipe with rustc, we need to provide suitable dynamic library search
35863570
// paths to rustc. This includes both:
@@ -3605,10 +3589,7 @@ impl<'test> TestCx<'test> {
36053589
p.set_extension(env::consts::EXE_EXTENSION);
36063590
p
36073591
};
3608-
debug!(?recipe_bin);
36093592

3610-
// FIXME(jieyouxu): explain what the hecc we are doing here.
3611-
// FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
36123593
let mut rustc = Command::new(&self.config.rustc_path);
36133594
rustc
36143595
.arg("-o")
@@ -3673,7 +3654,6 @@ impl<'test> TestCx<'test> {
36733654
p.push("lib");
36743655
p
36753656
};
3676-
debug!(?stage_std_path);
36773657

36783658
// Compute dynamic library search paths for recipes.
36793659
let recipe_dylib_search_paths = {
@@ -3682,7 +3662,6 @@ impl<'test> TestCx<'test> {
36823662
paths.push(stage_std_path.join("rustlib").join(&self.config.host).join("lib"));
36833663
paths
36843664
};
3685-
debug!(?recipe_dylib_search_paths);
36863665

36873666
// Compute runtime library search paths for recipes. This is target-specific.
36883667
let target_runtime_dylib_search_paths = {
@@ -3691,8 +3670,6 @@ impl<'test> TestCx<'test> {
36913670
paths
36923671
};
36933672

3694-
// FIXME(jieyouxu): explain what the hecc we are doing here.
3695-
// FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
36963673
// FIXME(jieyouxu): please rename `TARGET_RPATH_ENV`, `HOST_RPATH_DIR` and
36973674
// `TARGET_RPATH_DIR`, it is **extremely** confusing!
36983675
let mut cmd = Command::new(&recipe_bin);

0 commit comments

Comments
 (0)