Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 82d9eaa

Browse files
committed
bootstrap: convert rust-mingw to use Tarball
1 parent 8ca46fc commit 82d9eaa

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

src/bootstrap/dist.rs

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -297,41 +297,23 @@ impl Step for Mingw {
297297
/// without any extra installed software (e.g., we bundle gcc, libraries, etc).
298298
fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
299299
let host = self.host;
300-
301300
if !host.contains("pc-windows-gnu") {
302301
return None;
303302
}
304303

305304
builder.info(&format!("Dist mingw ({})", host));
306305
let _time = timeit(builder);
307-
let name = pkgname(builder, "rust-mingw");
308-
let image = tmpdir(builder).join(format!("{}-{}-image", name, host.triple));
309-
let _ = fs::remove_dir_all(&image);
310-
t!(fs::create_dir_all(&image));
306+
307+
let mut tarball = Tarball::new(builder, "rust-mingw", &host.triple);
308+
tarball.set_product_name("Rust MinGW");
311309

312310
// The first argument is a "temporary directory" which is just
313311
// thrown away (this contains the runtime DLLs included in the rustc package
314312
// above) and the second argument is where to place all the MinGW components
315313
// (which is what we want).
316-
make_win_dist(&tmpdir(builder), &image, host, &builder);
314+
make_win_dist(&tmpdir(builder), tarball.image_dir(), host, &builder);
317315

318-
let mut cmd = rust_installer(builder);
319-
cmd.arg("generate")
320-
.arg("--product-name=Rust-MinGW")
321-
.arg("--rel-manifest-dir=rustlib")
322-
.arg("--success-message=Rust-MinGW-is-installed.")
323-
.arg("--image-dir")
324-
.arg(&image)
325-
.arg("--work-dir")
326-
.arg(&tmpdir(builder))
327-
.arg("--output-dir")
328-
.arg(&distdir(builder))
329-
.arg(format!("--package-name={}-{}", name, host.triple))
330-
.arg("--component-name=rust-mingw")
331-
.arg("--legacy-manifest-dirs=rustlib,cargo");
332-
builder.run(&mut cmd);
333-
t!(fs::remove_dir_all(&image));
334-
Some(distdir(builder).join(format!("{}-{}.tar.gz", name, host.triple)))
316+
Some(tarball.generate())
335317
}
336318
}
337319

0 commit comments

Comments
 (0)