Skip to content

Commit

Permalink
Unix.link: catch EMLINK also on Windows (#6993)
Browse files Browse the repository at this point in the history
  • Loading branch information
nojb authored Feb 4, 2023
1 parent f7cf8d4 commit 9381573
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ Unreleased
- Fix dependency cycle when installing files to the bin section with
`glob_files` (#6764, fixes #6708, @gridbugs)

- Handle "Too many links" errors when using Dune cache on Windows (#6993, @nojb)

3.6.2 (2022-12-21)
------------------

Expand Down
5 changes: 4 additions & 1 deletion src/dune_cache/local.ml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ end
hard links on [$file] will be allowed, triggering the [EMLINK] code path. *)
let link_even_if_there_are_too_many_links_already ~src ~dst =
try Path.link src dst
with Unix.Unix_error (Unix.EMLINK, _, _) ->
with
| Unix.Unix_error (Unix.EMLINK, _, _)
| Unix.Unix_error (Unix.EUNKNOWNERR -1442, _, _) (* Needed for OCaml < 5.1 *)
->
Temp.with_temp_file ~dir:temp_dir ~prefix:"dune" ~suffix:"copy" ~f:(function
| Error e -> raise e
| Ok temp_file ->
Expand Down

0 comments on commit 9381573

Please sign in to comment.