diff --git a/master_changes.md b/master_changes.md index 3a947b6ac60..fec7d80d7cf 100644 --- a/master_changes.md +++ b/master_changes.md @@ -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 internal install to avoid permission mismatch errors [#5796 @kit-ty-kate - fix #5781] ## Config report diff --git a/src/state/opamSysInteract.ml b/src/state/opamSysInteract.ml index 2b460749041..262aab4aa74 100644 --- a/src/state/opamSysInteract.ml +++ b/src/state/opamSysInteract.ml @@ -276,10 +276,20 @@ 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 fstab -> + let content = OpamFilename.read fstab in + let content = Re.replace_string re ~by:("noacl,"^orig) content in + OpamFilename.with_open_out_bin_atomic fstab + (fun oc -> Stdlib.output_string oc content) + let install ~packages = let open OpamProcess.Job.Op in let cygwin_root = internal_cygroot () in let cygwin_bin = cygwin_root / "bin" in + let fstab = cygwin_root / "etc" // "fstab" in let cygcheck = cygwin_bin // cygcheckexe in let local_cygwin_setupexe = cygsetup () in if OpamFilename.exists cygcheck then @@ -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 fstab; Done ()); cygcheck