Skip to content

Commit 2eb8810

Browse files
committed
compiletest/rmake: move stage_std_path and recipe_bin closer to use site
1 parent 6ca3109 commit 2eb8810

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3543,19 +3543,6 @@ impl<'test> TestCx<'test> {
35433543
support_lib_path.push(format!("{}-tools-bin", stage));
35443544
support_lib_path.push("librun_make_support.rlib");
35453545

3546-
let mut stage_std_path = PathBuf::new();
3547-
stage_std_path.push(&build_root);
3548-
stage_std_path.push(&stage);
3549-
stage_std_path.push("lib");
3550-
3551-
// Then, we need to build the recipe `rmake.rs` and link in the support library.
3552-
// FIXME(jieyouxu): use `std::env::consts::EXE_EXTENSION`.
3553-
let recipe_bin = base_dir.join(if self.config.target.contains("windows") {
3554-
"rmake.exe"
3555-
} else {
3556-
"rmake"
3557-
});
3558-
35593546
// FIXME(jieyouxu): explain what the hecc we are doing here.
35603547
let mut support_lib_deps = PathBuf::new();
35613548
support_lib_deps.push(&build_root);
@@ -3583,6 +3570,15 @@ impl<'test> TestCx<'test> {
35833570
host_dylib_env_paths.extend(orig_dylib_env_paths.iter().cloned());
35843571
let host_dylib_env_paths = env::join_paths(host_dylib_env_paths).unwrap();
35853572

3573+
// Finally, we need to run the recipe binary to build and run the actual tests.
3574+
// FIXME(jieyouxu): use `std::env::consts::EXE_EXTENSION`.
3575+
let recipe_bin = base_dir.join(if self.config.target.contains("windows") {
3576+
"rmake.exe"
3577+
} else {
3578+
"rmake"
3579+
});
3580+
debug!(?recipe_bin);
3581+
35863582
// FIXME(jieyouxu): explain what the hecc we are doing here.
35873583
// FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
35883584
let mut cmd = Command::new(&self.config.rustc_path);
@@ -3624,8 +3620,11 @@ impl<'test> TestCx<'test> {
36243620
self.fatal_proc_rec("run-make test failed: could not build `rmake.rs` recipe", &res);
36253621
}
36263622

3627-
// Finally, we need to run the recipe binary to build and run the actual tests.
3628-
debug!(?recipe_bin);
3623+
// FIXME(jieyouxu): explain what the hecc we are doing here.
3624+
let mut stage_std_path = PathBuf::new();
3625+
stage_std_path.push(&build_root);
3626+
stage_std_path.push(&stage);
3627+
stage_std_path.push("lib");
36293628

36303629
// FIXME(jieyouxu): explain what the hecc we are doing here.
36313630
let mut dylib_env_paths = orig_dylib_env_paths.clone();

0 commit comments

Comments
 (0)