Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005250OCamlruntime system and C interfacepublic2011-04-07 16:022017-03-15 11:16
Assigned Todra 
PlatformOSOS Version
Product Version3.12.0 
Target VersionFixed 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.
doligez (administrator)
2016-04-19 14:08

For the first issue, the error message is now fully informative.

For the second issue, we should ignore directories while searching in the path, because that's what the shell does (as well as ocaml on non-cygwin systems).

- 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 / +beta1
2015-11-20 18:39 xleroy Note Added: 0014759
2016-04-19 14:08 doligez Note Added: 0015810
2016-04-19 14:08 doligez Target Version 4.03.0+dev / +beta1 => 4.03.1+dev
2016-12-07 17:47 shinwell Category OCaml general => OCaml runtime system
2016-12-08 10:45 shinwell Assigned To => dra
2016-12-08 10:45 shinwell Status acknowledged => assigned
2017-02-16 14:00 doligez Target Version 4.03.1+dev => undecided
2017-02-23 16:43 doligez Category OCaml runtime system => runtime system
2017-03-03 17:45 doligez Category runtime system => runtime system and C interface
2017-03-15 11:16 doligez Target Version undecided =>

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker