/// Build the `rust-mingw` installer component.
///
/// This contains all the bits and pieces to run the MinGW Windows targets
/// without any extra installed software (e.g. we bundle gcc, libraries, etc).
/// Currently just shells out to a python script, but that should be rewritten
/// in Rust.
Build the `rust-mingw` installer component.
This contains all the bits and pieces to run the MinGW Windows targets
without any extra installed software .
Currently just shells out to a python script, but that should be rewritten
in Rust.
Build the ` rust - mingw ` installer component . This contains all the bits and pieces to run the MinGW Windows targets without any extra installed software . Currently just shells out to a python script but that should be rewritten in Rust .
pub fn mingw(build: &Build, host: &str) {
    println!("Dist mingw ({})", host);
    let name = format!("rust-mingw-{}", package_vers(build));
    let image = tmpdir(build).join(format!("{}-{}-image", name, host));
    let _ = fs::remove_dir_all(&image);
    // The first argument to the script is a "temporary directory" which is just
    // thrown away (this contains the runtime DLLs included in the rustc package
    // above) and the second argument is where to place all the MinGW components
    // (which is what we want).
    //
    // FIXME: this script should be rewritten into Rust
    let mut cmd = Command::new("python");
    cmd.arg(build.src.join("src/etc/make-win-dist.py"))
       .arg(tmpdir(build))
       .arg(&image)
       .arg(host);
    build.run(&mut cmd);
    let mut cmd = Command::new("sh");
    cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh")))
       .arg("--product-name=Rust-MinGW")
       .arg("--rel-manifest-dir=rustlib")
       .arg("--success-message=Rust-MinGW-is-installed.")
       .arg(format!("--image-dir={}", sanitize_sh(&image)))
       .arg(format!("--work-dir={}", sanitize_sh(&tmpdir(build))))
       .arg(format!("--output-dir={}", sanitize_sh(&distdir(build))))
       .arg(format!("--package-name={}-{}", name, host))
       .arg("--component-name=rust-mingw")
       .arg("--legacy-manifest-dirs=rustlib,cargo");
    build.run(&mut cmd);
    t!(fs::remove_dir_all(&image));
}
pub fn mingw ( build : & Build , host : & str ) { println ! ( " " host ) ; let name = format ! ( " " package_vers ( build ) ) ; let image = tmpdir ( build ) . join ( format ! ( " " name host ) ) ; let _ = fs :: remove_dir_all ( & image ) ; // The first argument to the script is a "temporary directory" which is just // thrown away (this contains the runtime DLLs included in the rustc package // above) and the second argument is where to place all the MinGW components // (which is what we want). // // FIXME: this script should be rewritten into Rust let mut cmd = Command :: new ( " " ) ; cmd . arg ( build . src . join ( " " ) ) . arg ( tmpdir ( build ) ) . arg ( & image ) . arg ( host ) ; build . run ( & mut cmd ) ; let mut cmd = Command :: new ( " " ) ; cmd . arg ( sanitize_sh ( & build . src . join ( " " ) ) ) . arg ( " " ) . arg ( " " ) . arg ( " " ) . arg ( format ! ( " " sanitize_sh ( image ) ) ) . arg ( format ! ( " " sanitize_sh ( tmpdir ( build ) ) ) ) . arg ( format ! ( " " sanitize_sh ( distdir ( build ) ) ) ) . arg ( format ! ( " " name host ) ) . arg ( " " ) . arg ( " " ) ; build . run ( & mut cmd ) ; t ! ( fs remove_dir_all ( image ) ) ; }
Build the `rust-mingw` installer component.
Build the ` rust - mingw ` installer component .
build
&Build
host
&str