about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2024-08-18 23:41:48 -0500
committerGitHub <noreply@github.com>2024-08-18 23:41:48 -0500
commitf956bceb6a1302fe3fcb56558e06d3dcbb5d2244 (patch)
treec7b0b6fe43611faddb3c99caa1c377bdc0bffc1d /src/bootstrap
parent582b0a662333b41ca7e083c65d8e3423dc05eb33 (diff)
parent320be47410e2a826c47097790b790b3a1826d073 (diff)
downloadrust-f956bceb6a1302fe3fcb56558e06d3dcbb5d2244.tar.gz
rust-f956bceb6a1302fe3fcb56558e06d3dcbb5d2244.zip
Rollup merge of #129116 - Zalathar:compiler-rt, r=Mark-Simulacrum
Include a copy of `compiler-rt` source in the `download-ci-llvm` tarball

This will make it possible to experiment with allowing `download-ci-llvm` builds to build `library/profiler_builtins`, without needing to check out the `src/llvm-project` submodule.

By itself, this PR just adds the files to the tarball, but doesn't actually do anything with them. The idea is that once this is merged, it will then be much easier to proceed with work on the necessary bootstrap changes (using the real downloaded tarball), without having to rig up weird hacks to simulate downloading a modified tarball.

---

Adding these files to the compressed tarballs appears to increase its size by a negligible amount (<1 MB out of 400/800+ MB).

The uncompressed size is about 14 MB (out of 2+ GB for the whole tarball).

(The excluded test files would have been another 35 MB.)
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/download-ci-llvm-stamp2
-rw-r--r--src/bootstrap/src/core/build_steps/dist.rs13
2 files changed, 14 insertions, 1 deletions
diff --git a/src/bootstrap/download-ci-llvm-stamp b/src/bootstrap/download-ci-llvm-stamp
index 11316004412..90901530501 100644
--- a/src/bootstrap/download-ci-llvm-stamp
+++ b/src/bootstrap/download-ci-llvm-stamp
@@ -1,4 +1,4 @@
 Change this file to make users of the `download-ci-llvm` configuration download
 a new version of LLVM from CI, even if the LLVM submodule hasn’t changed.
 
-Last change is for: https://github.com/rust-lang/rust/pull/125642
+Last change is for: https://github.com/rust-lang/rust/pull/129116
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index 530eb9b446a..24894251017 100644
--- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -2322,6 +2322,19 @@ impl Step for RustDev {
         let link_type = if builder.llvm_link_shared() { "dynamic" } else { "static" };
         t!(std::fs::write(tarball.image_dir().join("link-type.txt"), link_type), dst_libdir);
 
+        // Copy the `compiler-rt` source, so that `library/profiler_builtins`
+        // can potentially use it to build the profiler runtime without needing
+        // to check out the LLVM submodule.
+        copy_src_dirs(
+            builder,
+            &builder.src.join("src").join("llvm-project"),
+            &["compiler-rt"],
+            // The test subdirectory is much larger than the rest of the source,
+            // and we currently don't use these test files anyway.
+            &["compiler-rt/test"],
+            tarball.image_dir(),
+        );
+
         Some(tarball.generate())
     }
 }