Skip to content

Commit

Permalink
Disable ACL in Cygwin to avoid permission missmatch errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Feb 15, 2024
1 parent e43b682 commit db04e53
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ users)
## Init
* Add rsync package to internal Cygwin packages list (enables local pinning and is used by the VCS backends [#5808 @dra27]
* Recommend enabling Developer Mode on Windows [#5831 @dra27]
* Disable ACL in Cygwin to avoid permission missmatch errors [#5796 @kit-ty-kate - fix #5781]

## Config report

Expand Down
11 changes: 11 additions & 0 deletions src/state/opamSysInteract.ml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ module Cygwin = struct
in
OpamDownload.download_as ~overwrite ?checksum url_setupexe dst

let set_fstab_noacl =
let orig = "binary," in
let re = Re.compile (Re.str orig) in
fun () ->
let file = OpamFilename.of_string "/etc/fstab" in
let content = OpamFilename.read file in
let content = Re.replace_string re ~by:("noacl,"^orig) content in
OpamFilename.with_open_out_bin_atomic file
(fun oc -> Stdlib.output_string oc content)

let install ~packages =
let open OpamProcess.Job.Op in
let cygwin_root = internal_cygroot () in
Expand Down Expand Up @@ -317,6 +327,7 @@ module Cygwin = struct
(OpamFilename.to_string local_cygwin_setupexe)
args @@> fun r ->
OpamSystem.raise_on_process_error r;
set_fstab_noacl ();
Done ());
cygcheck

Expand Down

0 comments on commit db04e53

Please sign in to comment.