Skip to content

Commit ac19c3b

Browse files
committed
Auto merge of #76856 - jonas-schievink:dist-rustc-src, r=Mark-Simulacrum
Distribute rustc sources as part of `rustc-dev` They can be used to provide IDE features when working on rustc plugins/backends/etc without having to locate a separate Rust checkout. r? `@Mark-Simulacrum`
2 parents a2c82df + ee1e934 commit ac19c3b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/bootstrap/dist.rs

+12
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,18 @@ impl Step for RustcDev {
793793
let stamp = compile::librustc_stamp(builder, compiler_to_use, target);
794794
copy_target_libs(builder, target, &image, &stamp);
795795

796+
// Copy compiler sources.
797+
let dst_src = image.join("lib/rustlib/rustc-src/rust");
798+
t!(fs::create_dir_all(&dst_src));
799+
800+
let src_files = ["Cargo.lock"];
801+
// This is the reduced set of paths which will become the rustc-dev component
802+
// (essentially the compiler crates and all of their path dependencies).
803+
copy_src_dirs(builder, &builder.src, &["compiler"], &[], &dst_src);
804+
for file in src_files.iter() {
805+
builder.copy(&builder.src.join(file), &dst_src.join(file));
806+
}
807+
796808
let mut cmd = rust_installer(builder);
797809
cmd.arg("generate")
798810
.arg("--product-name=Rust")

0 commit comments

Comments
 (0)