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

ocamldebug alters filenames and can't find source #3859

Closed
vicuna opened this issue Oct 9, 2002 · 3 comments
Closed

ocamldebug alters filenames and can't find source #3859

vicuna opened this issue Oct 9, 2002 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 9, 2002

Original bug ID: 1421
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Scott Crosby
Version: 3.04
OS: linux
Submission from: gh-1216.gh.rice.edu (128.42.216.216)

I create a file TEMP.ml

I compile it with 'ocamlc -g TEMP.ml'

I then attempt to run it in the debugger, but the debugger cannot find the
source file. I strace ocamldebug and find that its trying to load in 'tEMP.ml'
as source.

For some reason, its attempting to do case canonicalization and messing up.

Scott

@vicuna
Copy link
Author

vicuna commented Oct 11, 2002

Comment author: administrator

On Fri, 11 Oct 2002 10:13:17 +0200, Maxence Guesdon maxence.guesdon@inria.fr writes:

You should not use capitalized ames for ocaml source files.

This constraint may not be clear in the documentation : Here is an
extract from the ocaml reference manual:

I was just trying to debug some code in a toplevel flatfile, no
module. (I'm going to be coding in metaocaml soon, it doesn't support
modules.) Ocaml implicityly made a module for me with the name 'TEMP',
and stored the metadata in 'TEMP.ml*' files. The only reason I was
doing ocamlc instad of #use in the toplevel was to get it into the
debugger so I could see what was broken.

<< When the compiler encounters a reference to a free module
identifier Mod, it looks in the search path for a file mod.cmi (note
lowercasing of first letter) ... >>

( http://pauillac.inria.fr/ocaml/htmlman/manual022.html )

Perhaps it should warn about using a capitalized filename? Or try the
actual filename first, then try the lowercased version. It generated a
compiled file that was capitalized. For a while with this bug, I
thought the debugger might be broken, claiming that it couldn't find
the source file 'TEMP.ml'. It was only with an strace that I saw what
the real cause was.

What if I have a bunch of toplevel (not using a module) stuff in a
file called 'foo', will the module be called 'Foo' with the file being
'foo.ml', or will it try to create a module called 'foo', then error
out because its not capitalized?

Scott

@vicuna
Copy link
Author

vicuna commented Oct 11, 2002

Comment author: administrator

I create a file TEMP.ml

I compile it with 'ocamlc -g TEMP.ml'

I then attempt to run it in the debugger, but the debugger cannot find the
source file. I strace ocamldebug and find that its trying to load in 'tEMP.ml'
as source.

For some reason, its attempting to do case canonicalization and messing up.

You should not use capitalized ames for ocaml source files.

This constraint may not be clear in the documentation : Here is an extract from the ocaml reference manual:

<< When the compiler encounters a reference to a free module identifier Mod, it looks in the search path for a file mod.cmi (note lowercasing of first letter) ... >>

( http://pauillac.inria.fr/ocaml/htmlman/manual022.html )

Thanks for your report,

--
Maxence Guesdon

@vicuna vicuna closed this as completed Oct 11, 2002
@vicuna
Copy link
Author

vicuna commented Oct 11, 2002

Comment author: administrator

Perhaps it should [...] try the
actual filename first, then try the lowercased version. It generated a
compiled file that was capitalized.

Right. We have plans to do this, but there's a twist with ocamldep on
case-insensitive file systems (Windows, MacOS X) that needs to be
solved first. Stay tuned.

  • Xavier Leroy

@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant