Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix.link: catch EMLINK also on Windows #6993

Merged
merged 4 commits into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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