Skip to content

Commit

Permalink
Rollup merge of #129116 - Zalathar:compiler-rt, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
tgross35 committed Aug 19, 2024
2 parents 582b0a6 + 320be47 commit f956bce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/download-ci-llvm-stamp
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
Expand Down

0 comments on commit f956bce

Please sign in to comment.