dune icon indicating copy to clipboard operation
dune copied to clipboard

Can't install ocamlfind as package on Windows due to missing .exe extension in ocamlfind.install

Open gridbugs opened this issue 6 months ago • 0 comments

When building the ocamlfind package on Windows with Dune package management, ocamlfind's executable files have a .exe extension, however the ocamlfind.install file omits the .exe extensions. Its contents is:

bin: [
  "src/findlib/ocamlfind" {"ocamlfind"}
  "?src/findlib/ocamlfind_opt" {"ocamlfind"}
  "?tools/safe_camlp4"
]
toplevel: ["src/findlib/topfind"]

The error when trying to build a project which depends on ocamlfind:

> dune build
Error: entry
_build/.sandbox/b5bb9b241be80d0a0513d55474f899ef/_private/default/.pkg/ocamlfind/source/src/findlib/ocamlfind
in
_build/.sandbox/b5bb9b241be80d0a0513d55474f899ef/_private/default/.pkg/ocamlfind/source/ocamlfind.install
does not exist
-> required by _build/_private/default/.pkg/ocamlfind/target

Modifying this file to add the .exe extensions on executable files fixes the issue, for example by manually adding this action as the first action in the install command in ocamlfind's lockfile: (run sed -i "'s/ocamlfind\\(_opt\\)\\?/&.exe/'" ocamlfind.install).

Repro case: https://github.com/gridbugs/dune-windows-repros/tree/main/repro3

gridbugs avatar Sep 08 '25 05:09 gridbugs