mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Merge pull request #2610 from rtfeldman/windows_fixes
`cargo build` on windows
This commit is contained in:
commit
d91df42147
15 changed files with 142 additions and 67 deletions
|
@ -20,7 +20,6 @@ use std::io;
|
|||
use std::io::{BufReader, BufWriter};
|
||||
use std::mem;
|
||||
use std::os::raw::c_char;
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::time::{Duration, SystemTime};
|
||||
|
@ -1615,9 +1614,14 @@ fn surgery_impl(
|
|||
let flushing_data_duration = flushing_data_start.elapsed().unwrap();
|
||||
|
||||
// Make sure the final executable has permision to execute.
|
||||
let mut perms = fs::metadata(out_filename)?.permissions();
|
||||
perms.set_mode(perms.mode() | 0o111);
|
||||
fs::set_permissions(out_filename, perms)?;
|
||||
// TODO windows alternative?
|
||||
#[cfg(target_family = "unix")]
|
||||
{
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
let mut perms = fs::metadata(out_filename)?.permissions();
|
||||
perms.set_mode(perms.mode() | 0o111);
|
||||
fs::set_permissions(out_filename, perms)?;
|
||||
}
|
||||
|
||||
let total_duration = total_start.elapsed().unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue