bootstrap: make copying linker binaries conditional

This commit is contained in:
Joseph Ryan 2023-10-02 16:50:23 -07:00
parent 5333b878c8
commit f55c879669

View File

@ -167,12 +167,14 @@ impl Step for Std {
.rustc_snapshot_sysroot() .rustc_snapshot_sysroot()
.join("lib") .join("lib")
.join("rustlib") .join("rustlib")
.join(&compiler.host.triple) .join(compiler.host.triple)
.join("bin"); .join("bin");
let target_sysroot_bin = if src_sysroot_bin.exists() {
builder.sysroot_libdir(compiler, target).parent().unwrap().join("bin"); let target_sysroot_bin =
t!(fs::create_dir_all(&target_sysroot_bin)); builder.sysroot_libdir(compiler, target).parent().unwrap().join("bin");
builder.cp_r(&src_sysroot_bin, &target_sysroot_bin); t!(fs::create_dir_all(&target_sysroot_bin));
builder.cp_r(&src_sysroot_bin, &target_sysroot_bin);
}
} }
let mut cargo = builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "build"); let mut cargo = builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "build");