You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1217 Reporter: administrator Status: closed (set by @xavierleroy on 2013-08-31T10:46:07Z) Resolution: won't fix Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
Bug description
The 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.)
The text was updated successfully, but these errors were encountered:
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.
Original bug ID: 1217
Reporter: administrator
Status: closed (set by @xavierleroy on 2013-08-31T10:46:07Z)
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
The 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.)
The text was updated successfully, but these errors were encountered: