rework cargo invocation

This commit is contained in:
Folkert 2022-11-11 12:28:28 +01:00
parent 8787a1bed2
commit 926136b7e3
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 10 additions and 10 deletions

View file

@ -632,12 +632,16 @@ pub fn rebuild_host(
},
);
let mut cargo_cmd = if cfg!(windows) { rustup() } else { cargo() };
let mut cargo_cmd = if cfg!(windows) {
// on windows, we need the nightly toolchain so we can use `-Z export-executable-symbols`
// using `+nightly` only works when running cargo through rustup
let mut cmd = rustup();
cmd.args(["run", "nightly", "cargo"]);
if cfg!(windows) {
// on windows, we need the `+nightly` toolchain so we can use `-Z export-executable-symbols`
cargo_cmd.args(["run", "nightly", "cargo"]);
}
cmd
} else {
cargo()
};
cargo_cmd.arg("build").current_dir(cargo_dir);
// Rust doesn't expose size without editing the cargo.toml. Instead just use release.