You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which appears to be caused by file_or_exe_exists not appending ".exe" to the filename when Sys.os_type = "Cygwin" (which is what I see as os_type when compiling on cygwin):
It was suggested on the mailing list that a more elaborate fix was necessary, using Filename.check_suffix Config.default_executable_name ".exe" as the condition, but I haven't done that (yet). Let me know if I should.
Sorry - uploaded that patch before discovering that it was the same as the one in the pull request (I'd read Damien's note first). :$
My suggestion on the OCaml list is indeed flawed, but not quite for Damien's reasons - Cygwin executables can choose not to have the ".exe" suffix and still be executable.
It would still be useful to have a new Sys.executable_suffix for the native ports - that way MSVC, MSVC64, MinGW & MinGW64 could have ".exe" (i.e. executable files must end with .exe) but Cygwin, like Unix, would remain with "" and simply be an annoying special case in code!
Damien, I'm still seeing this on 4.02.1, am I missing something?
protz@Joprotze-Z420:~/.opam/4.02.1/build/fix.20130611 $ ocamlbuild -use-ocamlfind -cflags "-g" -lflags "-g" -classic-display Fix.cma Fix.cmxa
Failure: ocamlfind not found on path, but -no-ocamlfind not used.
Original bug ID: 6626
Reporter: algoriddle
Status: closed (set by @damiendoligez on 2014-12-17T23:18:01Z)
Resolution: fixed
Priority: normal
Severity: major
Platform: Cygwin
OS: Cygwin
Version: 4.02.1
Fixed in version: 4.02.2+dev / +rc1
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Bug description
"Failure: ocamlfind not found on path, but -no-ocamlfind not used."
ocamlbuild should append .exe extension to filename when looking for
executables on os_type 'Cygwin' (same as os_type 'Win32')
Steps to reproduce
ocamlbuild fails in "opam install react" with the following error:
"Failure: ocamlfind not found on path, but -no-ocamlfind not used."
This is where the exception is thrown:
https://github.com/ocaml/ocaml/blob/trunk/ocamlbuild/options.ml#L295
It is the result of Command.search_in_path not finding ocamlfind:
https://github.com/ocaml/ocaml/blob/trunk/ocamlbuild/command.ml#L130
Which appears to be caused by file_or_exe_exists not appending ".exe" to the filename when Sys.os_type = "Cygwin" (which is what I see as os_type when compiling on cygwin):
https://github.com/ocaml/ocaml/blob/trunk/ocamlbuild/command.ml#L128
Additional information
I submitted a simple fix here: #108
It was suggested on the mailing list that a more elaborate fix was necessary, using Filename.check_suffix Config.default_executable_name ".exe" as the condition, but I haven't done that (yet). Let me know if I should.
File attachments
The text was updated successfully, but these errors were encountered: