Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001217OCamlOCaml generalpublic2002-06-26 16:382013-08-31 12:46
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
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 foo.ml 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
safety.

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

TagsNo tags attached.
Attached Files

- Relationships

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

Fixed the typo in the doc.
Not sure the feature is worth the trouble.
(0006792)
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker