[ITA] ocaml 4.14.0

David Allsopp David.Allsopp@cl.cam.ac.uk
Wed Aug 24 09:28:46 GMT 2022


Corinna Vinschen wrote:
> On Aug 23 20:00, David Allsopp wrote:
> > Jon Turney wrote:
> > > I'm confused here: /usr/lib/ocaml/camlheaderd[di] look like
> > > executables (according to file etc.)
> > >
> > > If they genuinely aren't, then perhaps they shouldn't have execute
> > > permission (which is I think what is causing them to be caught by
> > > that piece of code in cygport...)
> >
> > ocamlc won't care about the executable bit, but these files are _data_
> > and so it will care if they end up with a .exe extension, because they
> > are open'd not exec'd.
> >
> > The files themselves form the start of executables produced by ocamlc.
> > For both Cygwin and native Windows, it's a tiny C program responsible
> > for locating ocamlrun (on Unix, it's just a shebang line) and the
> > bytecode itself gets appended.
> 
> Why is ocaml for Cygwin not produing shebang files as well?  After all,
> we're trying to be as Unix-compatible as possible.

I'm not 100% that this is the correct history, but I think it's down to being able to start the programs from outside a Cygwin bash prompt - i.e. the programs emitted want to have a .exe by default and it's strange to have ".exe" files with a shebang header (at least from outside Cygwin).

This part of OCaml is actually old enough (late nineties) that this executable was also used on "real" Unix systems where shebang didn't work properly :)

It is possible to configure Cygwin OCaml to use shebang headers (although at the moment only by changing Makefile.config after running configure)

All best,


David


More information about the Cygwin-apps mailing list