Skip to content

Commit c9b2410

Browse files
committed
Use "rust-installer tarball" to create rustc-src too
This gives us an extra rustc-src.tar.xz, which is 33% smaller than the .tar.gz!
1 parent f383cbf commit c9b2410

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/bootstrap/dist.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,13 +469,17 @@ pub fn rust_src(build: &Build) {
469469
write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes());
470470

471471
// Create plain source tarball
472-
let tarball = rust_src_location(build);
472+
let mut tarball = rust_src_location(build);
473+
tarball.set_extension(""); // strip .gz
474+
tarball.set_extension(""); // strip .tar
473475
if let Some(dir) = tarball.parent() {
474476
t!(fs::create_dir_all(dir));
475477
}
476-
let mut cmd = Command::new("tar");
477-
cmd.arg("-czf").arg(sanitize_sh(&tarball))
478-
.arg(&plain_name)
478+
let mut cmd = rust_installer(build);
479+
cmd.arg("tarball")
480+
.arg("--input").arg(&plain_name)
481+
.arg("--output").arg(sanitize_sh(&tarball))
482+
.arg("--work-dir=.")
479483
.current_dir(tmpdir(build));
480484
build.run(&mut cmd);
481485

0 commit comments

Comments
 (0)