Skip to content

Commit 626c36a

Browse files
authored
Rollup merge of #101942 - Mark-Simulacrum:fix-perf, r=jyn514
Revert "Copy stage0 binaries into stage0-sysroot" This reverts PR #101711. The PR broke the rustc/bootstrap benchmark on rustc-perf, I believe due to the assumption that the stage0 directory exists. Fixing that by just skipping this logic might be reasonable, but I think there's a larger discussion to be had around the right behavior when we don't have a single bin/ directory (when rustc= and cargo= are specified in config.toml). I think it's potentially reasonable to put those binaries (cargo, rustc, rustfmt?) into the bin directory, but for now just want to get us back to a healthy state. r? `@jyn514` (but would appreciate review from others as this is just a direct revert).
2 parents cda20a7 + f0c78ee commit 626c36a

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

src/bootstrap/compile.rs

-37
Original file line numberDiff line numberDiff line change
@@ -436,43 +436,6 @@ impl Step for StdLink {
436436
let libdir = builder.sysroot_libdir(target_compiler, target);
437437
let hostdir = builder.sysroot_libdir(target_compiler, compiler.host);
438438
add_to_sysroot(builder, &libdir, &hostdir, &libstd_stamp(builder, compiler, target));
439-
440-
if compiler.stage == 0 {
441-
// special handling for stage0, to make `rustup toolchain link` and `x dist --stage 0`
442-
// work for stage0-sysroot
443-
444-
// copy bin files from stage0/bin to stage0-sysroot/bin
445-
let sysroot = builder.out.join(&compiler.host.triple).join("stage0-sysroot");
446-
447-
let host = compiler.host.triple;
448-
let stage0_bin_dir = builder.out.join(&host).join("stage0/bin");
449-
let sysroot_bin_dir = sysroot.join("bin");
450-
t!(fs::create_dir_all(&sysroot_bin_dir));
451-
builder.cp_r(&stage0_bin_dir, &sysroot_bin_dir);
452-
453-
// copy all *.so files from stage0/lib to stage0-sysroot/lib
454-
let stage0_lib_dir = builder.out.join(&host).join("stage0/lib");
455-
if let Ok(files) = fs::read_dir(&stage0_lib_dir) {
456-
for file in files {
457-
let file = t!(file);
458-
let path = file.path();
459-
if path.is_file() && is_dylib(&file.file_name().into_string().unwrap()) {
460-
builder.copy(&path, &sysroot.join("lib").join(path.file_name().unwrap()));
461-
}
462-
}
463-
}
464-
465-
// copy codegen-backends from stage0
466-
let sysroot_codegen_backends = builder.sysroot_codegen_backends(compiler);
467-
t!(fs::create_dir_all(&sysroot_codegen_backends));
468-
let stage0_codegen_backends = builder
469-
.out
470-
.join(&host)
471-
.join("stage0/lib/rustlib")
472-
.join(&host)
473-
.join("codegen-backends");
474-
builder.cp_r(&stage0_codegen_backends, &sysroot_codegen_backends);
475-
}
476439
}
477440
}
478441

0 commit comments

Comments
 (0)