1
Fork 0

bootstrap: refactor showing the "dist" info

This commit is contained in:
Pietro Albini 2020-11-26 22:50:38 +01:00
commit fd4515cb3f
No known key found for this signature in database
GPG key ID: 3E06ABE80BAAF19C
2 changed files with 5 additions and 23 deletions

View file

@ -72,19 +72,14 @@ impl Step for Docs {
if !builder.config.docs {
return None;
}
builder.default_doc(None);
builder.info(&format!("Dist docs ({})", host));
let _time = timeit(builder);
let dest = "share/doc/rust/html";
let mut tarball = Tarball::new(builder, "rust-docs", &host.triple);
tarball.set_product_name("Rust Documentation");
tarball.add_dir(&builder.doc_out(host), dest);
tarball.add_file(&builder.src.join("src/doc/robots.txt"), dest, 0o644);
Some(tarball.generate())
}
}
@ -112,15 +107,11 @@ impl Step for RustcDocs {
if !builder.config.compiler_docs {
return None;
}
builder.default_doc(None);
builder.info(&format!("Dist compiler docs ({})", host));
let _time = timeit(builder);
let mut tarball = Tarball::new(builder, "rustc-docs", &host.triple);
tarball.set_product_name("Rustc Documentation");
tarball.add_dir(&builder.compiler_doc_out(host), "share/doc/rust/html/rustc");
Some(tarball.generate())
}
}
@ -301,9 +292,6 @@ impl Step for Mingw {
return None;
}
builder.info(&format!("Dist mingw ({})", host));
let _time = timeit(builder);
let mut tarball = Tarball::new(builder, "rust-mingw", &host.triple);
tarball.set_product_name("Rust MinGW");
@ -341,9 +329,6 @@ impl Step for Rustc {
let compiler = self.compiler;
let host = self.compiler.host;
builder.info(&format!("Dist rustc stage{} ({})", compiler.stage, host.triple));
let _time = timeit(builder);
let tarball = Tarball::new(builder, "rustc", &host.triple);
// Prepare the rustc "image", what will actually end up getting installed
@ -2318,9 +2303,6 @@ impl Step for LlvmTools {
}
}
builder.info(&format!("Dist LlvmTools ({})", target));
let _time = timeit(builder);
let mut tarball = Tarball::new(builder, "llvm-tools", &target.triple);
tarball.set_overlay(OverlayKind::LLVM);
tarball.is_preview(true);
@ -2375,9 +2357,6 @@ impl Step for RustDev {
}
}
builder.info(&format!("Dist RustDev ({})", target));
let _time = timeit(builder);
let mut tarball = Tarball::new(builder, "rust-dev", &target.triple);
tarball.set_overlay(OverlayKind::LLVM);

View file

@ -114,13 +114,17 @@ impl<'a> Tarball<'a> {
self.builder.install(&self.builder.src.join(file), &self.overlay_dir, 0o644);
}
let mut cmd = self.builder.tool_cmd(crate::tool::Tool::RustInstaller);
self.builder.info(&format!("Dist {} ({})", self.component, self.target));
let _time = crate::util::timeit(self.builder);
let mut component_name = self.component.clone();
if self.is_preview {
component_name.push_str("-preview");
}
let distdir = crate::dist::distdir(self.builder);
let mut cmd = self.builder.tool_cmd(crate::tool::Tool::RustInstaller);
cmd.arg("generate")
.arg(format!("--product-name={}", self.product_name))
.arg("--rel-manifest-dir=rustlib")
@ -137,7 +141,6 @@ impl<'a> Tarball<'a> {
.arg("--legacy-manifest-dirs=rustlib,cargo")
.arg(format!("--component-name={}", component_name));
self.builder.run(&mut cmd);
t!(std::fs::remove_dir_all(&self.temp_dir));
distdir.join(format!("{}-{}.tar.gz", self.pkgname, self.target))