Code change:
}; add_to_sysroot(builder, &libdir, &hostdir, &libstd_stamp(builder, compiler, target)); <ins> // Special case for stage0, to make `rustup toolchain link` and `x dist --stage 0` // work for stage0-sysroot. We only do this if the stage0 compiler comes from beta, // and is not set to a custom path. if compiler.stage == 0 && builder .build .config .initial_rustc .starts_with(builder.out.join(&compiler.host.triple).join("stage0/bin")) { // Copy bin files from stage0/bin to stage0-sysroot/bin let sysroot = builder.out.join(&compiler.host.triple).join("stage0-sysroot"); let host = compiler.host.triple; let stage0_bin_dir = builder.out.join(&host).join("stage0/bin"); let sysroot_bin_dir = sysroot.join("bin"); t!(fs::create_dir_all(&sysroot_bin_dir)); builder.cp_r(&stage0_bin_dir, &sysroot_bin_dir); // Copy all *.so files from stage0/lib to stage0-sysroot/lib let stage0_lib_dir = builder.out.join(&host).join("stage0/lib"); if let Ok(files) = fs::read_dir(&stage0_lib_dir) { for file in files { let file = t!(file); let path = file.path(); if path.is_file() && is_dylib(&file.file_name().into_string().unwrap()) { builder.copy(&path, &sysroot.join("lib").join(path.file_name().unwrap())); } } } // Copy codegen-backends from stage0 let sysroot_codegen_backends = builder.sysroot_codegen_backends(compiler); t!(fs::create_dir_all(&sysroot_codegen_backends)); let stage0_codegen_backends = builder .out .join(&host) .join("stage0/lib/rustlib") .join(&host) .join("codegen-backends"); builder.cp_r(&stage0_codegen_backends, &sysroot_codegen_backends); } </ins> } }

Related discussion:
text: Currently, the beta binaries are only present in ; has only the standard library, not any binaries. That causes two issues: doesn't work with stage0-sysroot, meaning there's no way to change the standard library and use those changes at runtime without doing a full stage 1 build doesn't work. This is very rare to want to do, but can be useful when modifying the process itself, to avoid long compile times. Copying the binaries into stage0-sysroot is an easy way to fix both problems at once. Mentoring instructions: Add a call in which copies the whole directory from . <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
We should also consider renaming to something else; the name is very confusing.
claim
The name is correct though. It is a directory you can pass in as argument to rustc.
so is . I'm not saying the name is wrong, just that it's ambiguous and not intuitive. Honestly I would rather rename all the directories to and change to or something.
is confusing too as already has a libstd. Just one from the bootstrap compiler rather than compiled from the current source.
Ok, then maybe :shrug: nearly anything would be less confusing than just appending IMO
Maybe rename stage0 to bootstrap and stage0-sysroot to stage0, matching stage1-...?
is confusing with the artifacts for , but maybe would work, keeping stage0-sysroot as is and renaming stage1 to stage1-sysroot
Reverted in
I actually wanted to recommend something like this as an alternative std benchmarking workflow. Currently I have to suggest a stage1 build.
I meant is very rare. I agree wanting to use a stage 0 toolchain with just the libstd changes is common :)
do you know when you'll have a chance to follow up here? If you're not planning to follow up, can you please release your assignment on the issue?
Sorry, I didn't follow this item recently. Ok, release it now.
claim I would like to take this issue up [with a bit of mentoring :)] if that's alright. It's my first time contributing!