Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001217OCaml~DO NOT USE (was: OCaml general)public2002-06-26 16:382013-08-31 12:46
Assigned To 
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001217: ocamldep should warn about non-existent dependencies
DescriptionThe manual for ocamldep states

 -I directory Add the given directory to the list of directories searched for
   source files. If a source file mentions an external compilation unit
   Bar, a dependency on that unit's interface bar.cmi is generated only if the
   source for bar is found in the current directory or in one of the
   directories specified with -I. Otherwise, Bar is assumed to be a module form
   the standard library, and no dependencies are generated. For programs that
   span multiple directories, it is recommended to pass ocamldep the same -I
   options that are passed to the compiler.

This is unsafe. In other words I had a bug in my Makefile and the -I
flags were not being passed to ocamldep. It took a while to notice
that bug. As a possible solution, I suggest that ocamldep check that
the module really does reside in the stdlib. There are other
solutions that you may prefer but I think we should err on the side of

Also, the word "form" should be changed to "from". (I often make this
mistake too.)

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2008-01-22 14:07

Fixed the typo in the doc.
Not sure the feature is worth the trouble.
doligez (administrator)
2012-01-25 14:43

I don't think we can implement this feature because ocamldep is not exact: because it works at the syntactic level and doesn't handle all the subtleties of the module system, it sometimes finds dependencies that are nonexistent.

A canonical example would be:

  open Random;;
  let random_state = State.make [| 1 |];;

On this file, currently ocamldep either ignores the reference to State (because it cannot find the .mli) or outputs a spurious dependency on state.cmi (if there is a file named state.mli).

With your change, in the first case it would output a spurious warning (that state.mli was not found).
This would rather discourage any serious use of the module system.

I'm setting this feature wish to resolved/wontfix, meaning that we won't work on it for the moment. We might come back to it one day if ocamldep gets an exact computation of dependencies.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2008-01-22 14:07 doligez Note Added: 0004427
2008-01-22 14:07 doligez Summary ocamldep => ocamldep should warn about non-existent dependencies
2008-01-22 14:07 doligez Description Updated
2012-01-25 14:43 doligez Note Added: 0006792
2012-01-25 14:43 doligez Status acknowledged => resolved
2012-01-25 14:43 doligez Resolution open => won't fix
2013-08-31 12:46 xleroy Status resolved => closed
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker