Skip to content

Commit 8736731

Browse files
committed
bootstrap: convert reproducible-artifacts to use Tarball
1 parent 2c08176 commit 8736731

File tree

1 file changed

+4
-41
lines changed

1 file changed

+4
-41
lines changed

src/bootstrap/dist.rs

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,47 +2034,10 @@ impl Step for ReproducibleArtifacts {
20342034
}
20352035

20362036
fn run(self, builder: &Builder<'_>) -> Self::Output {
2037-
let name = pkgname(builder, "reproducible-artifacts");
2038-
let tmp = tmpdir(builder);
2037+
let path = builder.config.rust_profile_use.as_ref()?;
20392038

2040-
// Prepare the image.
2041-
let image = tmp.join("reproducible-artifacts-image");
2042-
let _ = fs::remove_dir_all(&image);
2043-
2044-
if let Some(path) = &builder.config.rust_profile_use {
2045-
builder.install(std::path::Path::new(path), &image, 0o644);
2046-
} else {
2047-
return None;
2048-
}
2049-
2050-
// Prepare the overlay.
2051-
let overlay = tmp.join("reproducible-artifacts-overlay");
2052-
let _ = fs::remove_dir_all(&overlay);
2053-
builder.create_dir(&overlay);
2054-
builder.create(&overlay.join("version"), &builder.rust_version());
2055-
for file in &["COPYRIGHT", "LICENSE-APACHE", "LICENSE-MIT", "README.md"] {
2056-
builder.install(&builder.src.join(file), &overlay, 0o644);
2057-
}
2058-
2059-
// Create the final tarball.
2060-
let mut cmd = rust_installer(builder);
2061-
cmd.arg("generate")
2062-
.arg("--product-name=Rust")
2063-
.arg("--rel-manifest-dir=rustlib")
2064-
.arg("--success-message=reproducible-artifacts installed.")
2065-
.arg("--image-dir")
2066-
.arg(&image)
2067-
.arg("--work-dir")
2068-
.arg(&tmpdir(builder))
2069-
.arg("--output-dir")
2070-
.arg(&distdir(builder))
2071-
.arg("--non-installed-overlay")
2072-
.arg(&overlay)
2073-
.arg(format!("--package-name={}-{}", name, self.target.triple))
2074-
.arg("--legacy-manifest-dirs=rustlib,cargo")
2075-
.arg("--component-name=reproducible-artifacts");
2076-
2077-
builder.run(&mut cmd);
2078-
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, self.target.triple)))
2039+
let tarball = Tarball::new(builder, "reproducible-artifacts", &self.target.triple);
2040+
tarball.add_file(path, ".", 0o644);
2041+
Some(tarball.generate())
20792042
}
20802043
}

0 commit comments

Comments
 (0)