about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-09-19 04:21:11 +0000
committerbors <bors@rust-lang.org>2020-09-19 04:21:11 +0000
commitac19c3bda18ed5b692668725f7acac988f0aa2be (patch)
tree4094b69fbab2a6541d411573a0e96af274413f4c
parenta2c82df1f568cfc8f7469deb46b97c3c861818a0 (diff)
parentee1e9343b35c169a100654a511e21c47eb2cb0bc (diff)
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`
-rw-r--r--src/bootstrap/dist.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index cf73e570fa5..debe6e36a9b 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -793,6 +793,18 @@ impl Step for RustcDev {
         let stamp = compile::librustc_stamp(builder, compiler_to_use, target);
         copy_target_libs(builder, target, &image, &stamp);
 
+        // Copy compiler sources.
+        let dst_src = image.join("lib/rustlib/rustc-src/rust");
+        t!(fs::create_dir_all(&dst_src));
+
+        let src_files = ["Cargo.lock"];
+        // This is the reduced set of paths which will become the rustc-dev component
+        // (essentially the compiler crates and all of their path dependencies).
+        copy_src_dirs(builder, &builder.src, &["compiler"], &[], &dst_src);
+        for file in src_files.iter() {
+            builder.copy(&builder.src.join(file), &dst_src.join(file));
+        }
+
         let mut cmd = rust_installer(builder);
         cmd.arg("generate")
             .arg("--product-name=Rust")