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.)
This commit is contained in:
Trevor Gross 2024-08-18 23:41:48 -05:00 committed by GitHub
commit f956bceb6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View File

@ -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 hasnt 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

View File

@ -2322,6 +2322,19 @@ fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
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())
}
}