mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
rework cargo invocation
This commit is contained in:
parent
8787a1bed2
commit
926136b7e3
2 changed files with 10 additions and 10 deletions
|
@ -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) {
|
cmd
|
||||||
// on windows, we need the `+nightly` toolchain so we can use `-Z export-executable-symbols`
|
} else {
|
||||||
cargo_cmd.args(["run", "nightly", "cargo"]);
|
cargo()
|
||||||
}
|
};
|
||||||
|
|
||||||
cargo_cmd.arg("build").current_dir(cargo_dir);
|
cargo_cmd.arg("build").current_dir(cargo_dir);
|
||||||
// Rust doesn't expose size without editing the cargo.toml. Instead just use release.
|
// Rust doesn't expose size without editing the cargo.toml. Instead just use release.
|
||||||
|
|
|
@ -126,11 +126,7 @@ pub fn get_lib_path() -> Option<PathBuf> {
|
||||||
/// Gives a friendly error if cargo is not installed.
|
/// Gives a friendly error if cargo is not installed.
|
||||||
/// Also makes it easy to track where we use cargo in the codebase.
|
/// Also makes it easy to track where we use cargo in the codebase.
|
||||||
pub fn cargo() -> Command {
|
pub fn cargo() -> Command {
|
||||||
let command_str = if cfg!(windows) {
|
let command_str = "cargo";
|
||||||
r"%HOMEPATH%\.cargo\bin\cargo.exe"
|
|
||||||
} else {
|
|
||||||
"cargo"
|
|
||||||
};
|
|
||||||
|
|
||||||
if check_command_available(command_str) {
|
if check_command_available(command_str) {
|
||||||
Command::new(command_str)
|
Command::new(command_str)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue