Skip to content

Commit a12969e

Browse files
committed
walk up the ancestors
1 parent 1bc1993 commit a12969e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -683,14 +683,15 @@ impl Config {
683683
};
684684

685685
let initial_rustc = build_rustc.unwrap_or_else(|| {
686-
let out = if cfg!(test) { Path::new("../../build").to_path_buf() } else { out.clone() };
687-
686+
let out = if cfg!(test) {
687+
std::env::current_dir().unwrap().ancestors().nth(2).unwrap().join("build")
688+
} else {
689+
out.clone()
690+
};
688691
download_beta_toolchain(&dwn_ctx, &out);
692+
let target = if cfg!(test) { get_host_target() } else { host_target };
689693

690-
out.join(if cfg!(test) { get_host_target() } else { host_target })
691-
.join("stage0")
692-
.join("bin")
693-
.join(exe("rustc", host_target))
694+
out.join(target).join("stage0").join("bin").join(exe("rustc", host_target))
694695
});
695696

696697
let initial_sysroot = t!(PathBuf::from_str(

0 commit comments

Comments
 (0)