Skip to content

Commit b6910a3

Browse files
committed
walk up the ancestors
1 parent a3c7a16 commit b6910a3

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
@@ -679,14 +679,15 @@ impl Config {
679679
};
680680

681681
let initial_rustc = build_rustc.unwrap_or_else(|| {
682-
let out = if cfg!(test) { Path::new("../../build").to_path_buf() } else { out.clone() };
683-
682+
let out = if cfg!(test) {
683+
std::env::current_dir().unwrap().ancestors().nth(2).unwrap().join("build")
684+
} else {
685+
out.clone()
686+
};
684687
download_beta_toolchain(&dwn_ctx, &out);
688+
let target = if cfg!(test) { get_host_target() } else { host_target };
685689

686-
out.join(if cfg!(test) { get_host_target() } else { host_target })
687-
.join("stage0")
688-
.join("bin")
689-
.join(exe("rustc", host_target))
690+
out.join(target).join("stage0").join("bin").join(exe("rustc", host_target))
690691
});
691692

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

0 commit comments

Comments
 (0)