Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005250OCamlOCaml generalpublic2011-04-07 16:022015-11-20 18:39
Assigned To 
PlatformOSOS Version
Product Version3.12.0 
Target Version4.03.0+devFixed in Version 
Summary0005250: ocamlrun gets confused on cygwin if the name of the supplied bytecode file clashes with another file in the path
DescriptionSuppose 'foo' is a bytecode file, and a different file 'foo' is in the path, then we get the following behaviour:

  $ ocamlrun foo
  Fatal error: the file foo is not a bytecode executable file


  $ ocamlrun ./foo

works as expected.

If the genuine 'foo' is accessible from PATH, and the bogus 'foo' is a directory that is accessible earlier in PATH, then we get a more informative error message by invoking the genuine 'foo' directly:

  $ foo
  /path/to/bogus/foo not found or is not a bytecode executable file


  $ ./foo

works as expected.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2012-09-20 15:36

The first case also occurs under Mac OS X, although 4.00.0 gives the better error message.

Possible solution: add a "-" command-line flag to ocamlrun that says the rest of the command line is bytecode+arguments, and don't look for the bytecode in the path.

Another possible solution: add a "-path" flag to tell ocamlrun to look for the bytecode in the PATH (and don't do it by default), and use that option in the header of executable bytecode files.
xleroy (administrator)
2015-11-20 18:39

The user's manual documents the fact that "ocamlrun" searches its first argument in the path. Moreover, there is always the "ocamlrun ./foo" workaround. In the absence of new information, I move to close this PR.

- Issue History
Date Modified Username Field Change
2011-04-07 16:02 slindley New Issue
2011-05-02 12:53 doligez Status new => acknowledged
2012-07-10 15:14 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-20 15:36 doligez Note Added: 0008127
2012-09-20 15:36 doligez Target Version 4.00.1+dev => 4.00.2+dev
2013-07-11 16:09 doligez Target Version 4.00.2+dev => 4.02.0+dev
2013-07-12 18:15 doligez Target Version 4.02.0+dev => 4.01.1+dev
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-07-31 14:43 doligez Target Version 4.02.0+dev => 4.02.1+dev
2014-09-04 00:25 doligez Target Version 4.02.1+dev => undecided
2014-09-26 19:38 doligez Target Version undecided => 4.02.2+dev / +rc1
2015-01-16 19:55 doligez Target Version 4.02.2+dev / +rc1 => 4.02.3+dev
2015-07-15 15:29 doligez Target Version 4.02.3+dev => 4.03.0+dev
2015-11-20 18:39 xleroy Note Added: 0014759

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker