Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamlrun requires a period in the filename, else it produces a misleading error message #5532

Closed
vicuna opened this issue Mar 9, 2012 · 4 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link

commented Mar 9, 2012

Original bug ID: 5532
Reporter: edmcman
Assigned to: meyer
Status: closed (set by @xavierleroy on 2015-12-11T18:04:45Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.12.0
Category: runtime system and C interface

Bug description

ocamlrun refuses to run bytecode files with no period in the filename. Instead, it prints "Fatal error: the file is not a bytecode executable file", which is not necessarily true.

Steps to reproduce

edmcman@joethecat:/ocaml-3.12.0$ ocamlc test.ml -o test
edmcman@joethecat:
/ocaml-3.12.0$ ocamlrun test
Fatal error: the file test is not a bytecode executable file
edmcman@joethecat:/ocaml-3.12.0$ mv test test.
edmcman@joethecat:
/ocaml-3.12.0$ ocamlrun test.
edmcman@joethecat:~/ocaml-3.12.0$

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 10, 2012

Comment author: meyer

Hi,

It's not about period in the filename. Your file name seems to be a legitimate non-ocaml bytecode file found on path. It clashes on my machine with Linux /usr/bin/test. If you try ocamlrun ./test it will work.

It's documented under:
http://caml.inria.fr/pub/docs/manual-ocaml/manual024.html

I'm closing this PR, since it's not a bug.

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 10, 2012

Comment author: meyer

In fact, the improvement would to print out the full path to a file in the error message. I think this possibility is worth investigating.

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 10, 2012

Comment author: meyer

Error message improved in r12215.

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 10, 2012

Comment author: edmcman

Thanks, I think improving the error message is a good way to prevent such confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.