Skip to content

Commit

Permalink
Ignore EPERM on darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
emillon committed Nov 30, 2023
1 parent 0ea3957 commit 2da21f0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/dune_engine/build_system.ml
Original file line number Diff line number Diff line change
Expand Up @@ -539,14 +539,12 @@ end = struct
let remove_target_dir dir = Path.rm_rf (Path.build dir) in
let remove_target_file path =
try Path.Build.unlink path with
| Unix.Unix_error (EISDIR, _, _) ->
(* If target changed from a directory to a file, delete
in anyway. *)
remove_target_dir path
| Unix.Unix_error (ENOENT, _, _) -> ()
| Unix.Unix_error (x, y, z) ->
(* XXX debug only *)
Unix_error.Detailed.raise (x, y, z)
(* If target changed from a directory to a file, delete
in anyway. *)
| Unix.Unix_error (error, _, _) ->
(match error, Platform.OS.value with
| EISDIR, _ | EPERM, Darwin -> remove_target_dir path
| _ -> ())
| _ -> ()
in
Path.Build.Set.iter targets.files ~f:remove_target_file;
Expand Down

0 comments on commit 2da21f0

Please sign in to comment.