Skip to content

Commit b9bdb17

Browse files
committed
Reduce the contents of the rust-src component
1 parent 7248f67 commit b9bdb17

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

src/bootstrap/dist.rs

+29-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,35 @@ pub fn rust_src(build: &Build) {
480480
let dst_src = dst.join("rust");
481481
t!(fs::create_dir_all(&dst_src));
482482

483-
cp_r(&plain_dst_src, &dst_src);
483+
// This is the reduced set of paths which will become the rust-src component
484+
// (essentially libstd and all of its path dependencies)
485+
let std_src_dirs = [
486+
"src/build_helper",
487+
"src/liballoc",
488+
"src/liballoc_jemalloc",
489+
"src/liballoc_system",
490+
"src/libcollections",
491+
"src/libcompiler_builtins",
492+
"src/libcore",
493+
"src/liblibc",
494+
"src/libpanic_abort",
495+
"src/libpanic_unwind",
496+
"src/librand",
497+
"src/librustc_asan",
498+
"src/librustc_lsan",
499+
"src/librustc_msan",
500+
"src/librustc_tsan",
501+
"src/libstd",
502+
"src/libstd_unicode",
503+
"src/libunwind",
504+
"src/rustc/libc_shim",
505+
];
506+
507+
for item in &std_src_dirs {
508+
let dst = &dst_src.join(item);
509+
t!(fs::create_dir_all(dst));
510+
cp_r(&plain_dst_src.join(item), dst);
511+
}
484512

485513
// Create source tarball in rust-installer format
486514
let mut cmd = Command::new(SH_CMD);

0 commit comments

Comments
 (0)