mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
use the nightly compiler on windows to build platforms
This commit is contained in:
parent
2b6ddc990c
commit
5b952616a9
2 changed files with 14 additions and 1 deletions
|
@ -633,6 +633,12 @@ pub fn rebuild_host(
|
|||
);
|
||||
|
||||
let mut cargo_cmd = cargo();
|
||||
|
||||
if cfg!(windows) {
|
||||
// on windows, we need the `+nightly` toolchain so we can use `-Z export-executable-symbols`
|
||||
cargo_cmd.arg("+nightly");
|
||||
}
|
||||
|
||||
cargo_cmd.arg("build").current_dir(cargo_dir);
|
||||
// Rust doesn't expose size without editing the cargo.toml. Instead just use release.
|
||||
if matches!(opt_level, OptLevel::Optimize | OptLevel::Size) {
|
||||
|
|
|
@ -126,7 +126,14 @@ pub fn get_lib_path() -> Option<PathBuf> {
|
|||
/// Gives a friendly error if cargo is not installed.
|
||||
/// Also makes it easy to track where we use cargo in the codebase.
|
||||
pub fn cargo() -> Command {
|
||||
let command_str = "cargo";
|
||||
let command_str = if cfg!(windows) {
|
||||
// on windows, we need the version of cargo installed by rustup. The meaning of `cargo` is
|
||||
// different within a process that runs rust. So we need to explicitly refer to where
|
||||
// rustup put the binary
|
||||
r"%HOMEPATH%\.cargo\bin\cargo.exe"
|
||||
} else {
|
||||
"cargo"
|
||||
};
|
||||
|
||||
if check_command_available(command_str) {
|
||||
Command::new(command_str)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue