Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006626OCaml-for ocamlbuild use 12:072015-03-12 19:26
Assigned To 
PlatformCygwinOSCygwinOS Version
Product Version4.02.1 
Target VersionFixed in Version4.02.2+dev / +rc1 
Summary0006626: ocamlbuild on cygwin cannot find ocamlfind
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 Reproduceocamlbuild 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: [^]

It is the result of Command.search_in_path not finding ocamlfind: [^]

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): [^]
Additional InformationI submitted a simple fix here: [^]

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.
TagsNo tags attached.
Attached Filespatch file icon ocaml-4.02.1+cygwin.patch [^] (616 bytes) 2014-11-05 19:15 [Show Content]

- Relationships

-  Notes
doligez (administrator)
2014-10-29 17:52

I don't think it should be keyed on Config.default_executable_name: it's just a default name, not a strong statement about the OS.
dra (developer)
2014-11-05 19:25

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!
doligez (administrator)
2014-12-18 00:16

This patch was applied in trunk (commit 15577) and 4.02 (15578).
protz (manager)
2015-03-12 19:26

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.

- Issue History
Date Modified Username Field Change
2014-10-24 12:07 algoriddle New Issue
2014-10-29 17:52 doligez Note Added: 0012467
2014-11-05 19:15 dra File Added: ocaml-4.02.1+cygwin.patch
2014-11-05 19:25 dra Note Added: 0012492
2014-12-18 00:16 doligez Note Added: 0012846
2014-12-18 00:18 doligez Status new => closed
2014-12-18 00:18 doligez Resolution open => fixed
2014-12-18 00:18 doligez Fixed in Version => 4.02.2+dev / +rc1
2015-03-12 19:26 protz Note Added: 0013482
2017-02-23 16:34 doligez Category OCamlbuild (the tool) => for ocamlbuild use [^]
2017-02-23 16:44 doligez Category for ocamlbuild use [^] => -for ocamlbuild use [^]

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker