Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Mokhov <[email protected]>
  • Loading branch information
snowleopard committed Mar 17, 2021
1 parent 5777a55 commit 21e9c34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dune_engine/action_exec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ let rec exec t ~ectx ~eenv =
| exception _ -> Unix.symlink src dst);
Fiber.return Done
| Hardlink (src, dst) ->
(* CR-someday amokhov: Instead of always falling back to copying, we could
detect if hardlinking works on Windows and if yes, use it. We do this in
the Dune cache implementation, so we can share some code. *)
(match Sys.win32 with
| true -> Io.copy_file ~src ~dst:(Path.build dst) ()
| false -> (
Expand All @@ -263,8 +266,6 @@ let rec exec t ~ectx ~eenv =
let dst = Path.Build.to_string dst in
try Unix.link src dst with
| Unix.Unix_error (Unix.EEXIST, _, _) ->
(* CR amokhov: Maybe this should be an error? Not sure why we delete the
target in the symlink case. *)
Unix.unlink dst;
Unix.link src dst));
Fiber.return Done
Expand Down

0 comments on commit 21e9c34

Please sign in to comment.