caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamlbuild on cygwin
@ 2014-10-23 20:14 Gergely Szilvasy
  2014-10-23 23:16 ` David Allsopp
  0 siblings, 1 reply; 3+ messages in thread
From: Gergely Szilvasy @ 2014-10-23 20:14 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1774 bytes --]

Hello,

First of all, as this is my first post ever on this list, to all of you who
contribute to ocaml and its "ecosystem": a big thank you (ou encore mieux:
merci beaucoup)! It's brilliant stuff.

I'm trying to get as much of the ocaml/opam stack working on cygwin as
possible (as if there wasn't enough pain and suffering in the world
already).

Opam compiles without any issues, and I can switch to (let's say) 4.02.1
cleanly.

However, ocamlbuild fails for me in "opam install react" with the following
error:

"Failure: ocamlfind not found on path, but -no-ocamlfind not used."

(Note that react is required by utop, for example, so it's a pretty basic
requirement.)

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

I'm not expert on either ocaml or cygwin, so my analysis may be off.

--

In any case, I'm pretty sure this fairly simple bug is not a (very) recent
regression, so I'm wondering if anybody cares about opam/ocaml on cygwin?
I'd really like to use opam, because it looks to me this is the community's
preferred way of distributing bits. My question is, really, what is the
status of ocaml/opam on cygwin? Is there an alternative environment for
Windows + opam that works better? (I know about wodi, but I'd prefer opam.)
Is it worth spending time fixing these issues on cygwin?

Any thoughts?

Regards,
Gergely

[-- Attachment #2: Type: text/html, Size: 2591 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [Caml-list] ocamlbuild on cygwin
  2014-10-23 20:14 [Caml-list] ocamlbuild on cygwin Gergely Szilvasy
@ 2014-10-23 23:16 ` David Allsopp
  2014-10-24 14:54   ` Leonardo Laguna Ruiz
  0 siblings, 1 reply; 3+ messages in thread
From: David Allsopp @ 2014-10-23 23:16 UTC (permalink / raw)
  To: caml-list

Gergely Szilvasy wrote:
> I'm trying to get as much of the ocaml/opam stack working on cygwin as possible
> (as if there wasn't enough pain and suffering in the world already).

That's some pain! Not that it affects the bug you describe, but do you have a specific reason to use the Cygwin build, and not the MinGW/MSVC ports?

> Opam compiles without any issues, and I can switch to (let's say) 4.02.1 cleanly.
>
> However, ocamlbuild fails for me in "opam install react" with the following error:
>
> "Failure: ocamlfind not found on path, but -no-ocamlfind not used."
>
> (Note that react is required by utop, for example, so it's a pretty basic requirement.)
>
> 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

This test is weak, and the behaviour is a bug (=> raise a report in Mantis). ocamlbuild should query the Config module from the compiler libs and do one of the following:

1. Add an extra value ext_exe : string which would be ".exe" for Windows builds (*including* Cygwin) and "" for everything else.
2. Instead of detecting Sys.os_type = "Cygwin", instead do Filename.check_suffix Config.default_executable_name ".exe" (I can't check on this machine, but I'm fairly sure that ocamlc -config will shows the normal camlprog.exe for default_executable_name?)

> In any case, I'm pretty sure this fairly simple bug is not a (very) recent 
> regression, so I'm wondering if anybody cares about opam/ocaml on cygwin? 
> I'd really like to use opam, because it looks to me this is the community's 
> preferred way of distributing bits. My question is, really, what is the 
> status of ocaml/opam on cygwin? Is there an alternative environment for 
> Windows + opam that works better? (I know about wodi, but I'd prefer 
> opam.) Is it worth spending time fixing these issues on cygwin?

Cygwin is a targeted platform, so bugs in it are important - but I think that the small number of Windows OCaml users use the MinGW or MSVC ports so they may take a while to be noticed!

Opam status on Windows is partially recorded in https://github.com/ocaml/opam/issues/246.

HTH,


David

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] ocamlbuild on cygwin
  2014-10-23 23:16 ` David Allsopp
@ 2014-10-24 14:54   ` Leonardo Laguna Ruiz
  0 siblings, 0 replies; 3+ messages in thread
From: Leonardo Laguna Ruiz @ 2014-10-24 14:54 UTC (permalink / raw)
  To: David Allsopp; +Cc: caml-list



I found the same problem. The reason why I'm trying to use the cygwin port is because in the other ports debugging is very bad and compiling most of the libraries is a pain. But at the end, it is not possible to make commercial applications with cygwin. So I end up using the three ports when working on windows.


Leonardo



> On 23 okt 2014, at 18:16, David Allsopp <dra-news@metastack.com> wrote:
> 
> Gergely Szilvasy wrote:
>> I'm trying to get as much of the ocaml/opam stack working on cygwin as possible
>> (as if there wasn't enough pain and suffering in the world already).
> 
> That's some pain! Not that it affects the bug you describe, but do you have a specific reason to use the Cygwin build, and not the MinGW/MSVC ports?
> 
>> Opam compiles without any issues, and I can switch to (let's say) 4.02.1 cleanly.
>> 
>> However, ocamlbuild fails for me in "opam install react" with the following error:
>> 
>> "Failure: ocamlfind not found on path, but -no-ocamlfind not used."
>> 
>> (Note that react is required by utop, for example, so it's a pretty basic requirement.)
>> 
>> 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
> 
> This test is weak, and the behaviour is a bug (=> raise a report in Mantis). ocamlbuild should query the Config module from the compiler libs and do one of the following:
> 
> 1. Add an extra value ext_exe : string which would be ".exe" for Windows builds (*including* Cygwin) and "" for everything else.
> 2. Instead of detecting Sys.os_type = "Cygwin", instead do Filename.check_suffix Config.default_executable_name ".exe" (I can't check on this machine, but I'm fairly sure that ocamlc -config will shows the normal camlprog.exe for default_executable_name?)
> 
>> In any case, I'm pretty sure this fairly simple bug is not a (very) recent 
>> regression, so I'm wondering if anybody cares about opam/ocaml on cygwin? 
>> I'd really like to use opam, because it looks to me this is the community's 
>> preferred way of distributing bits. My question is, really, what is the 
>> status of ocaml/opam on cygwin? Is there an alternative environment for 
>> Windows + opam that works better? (I know about wodi, but I'd prefer 
>> opam.) Is it worth spending time fixing these issues on cygwin?
> 
> Cygwin is a targeted platform, so bugs in it are important - but I think that the small number of Windows OCaml users use the MinGW or MSVC ports so they may take a while to be noticed!
> 
> Opam status on Windows is partially recorded in https://github.com/ocaml/opam/issues/246.
> 
> HTH,
> 
> 
> David
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-24 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-23 20:14 [Caml-list] ocamlbuild on cygwin Gergely Szilvasy
2014-10-23 23:16 ` David Allsopp
2014-10-24 14:54   ` Leonardo Laguna Ruiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).