Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003190OCamlOCaml tools (ocaml{lex,yacc,dep,debug})public2004-09-29 05:112016-12-07 17:17
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003190: RFE: ocamldep flag to generate dependency on .cmi even when only .ml is present.
DescriptionFull_Name: Aleksey Nogin
Version: 3.08.1 and CVS
OS: Fedora Core Linux
Submission from: (

Currently, if ocamldep finds an .ml file, but no .mli file while resolving
dependencies, then ocamldep tries to do a make-compatible workaround.

E.g., if files and x.mli contain "open Y", and only is present, then
ocamldep will generate:

x.cmi: y.cmo
x.cmo: y.cmo
x.cmx: y.cmx

and "ocamldep -native" will generate

x.cmi: y.cmx
x.cmo: y.cmx
x.cmx: y.cmx

This is all fine in case of a build tool that is only paying attention to
timestamps (as make does). However, in case of a build tool (such as omake)
a) uses checksums to figure out when dependencies change and files need to be
b) knows that compiling an .ml may produce a .cmi (if no .mli exists),
the current ocamldep behaviour turns out to be suboptimal and even dangerous.

If the file changes in a way that y.cmo/.cmx change, but the types and
y.cmi remain the same, then the way ocamldep currently generates dependencies,
the x.cmi and x.cmo would end up being rebuilt for no good reason. What's worse,
if somehow a change in types affects the y.cmi, but y.cmo and/or y.cmx remain
unchanged, then the* files might end up not being rebuilt when they should

In short, I would like to request that an option be added to ocamldep (not sure
what a good name for it would be - may be "-natural"?) to generate the "natural"
dependencies even when only the .ml file is present.

E.g. in the example above, "ocamldep -natural" would generate

x.cmi: y.cmi
x.cmo: y.cmi
x.cmx: y.cmi y.cmx

TagsNo tags attached.
Attached Files

- Relationships
related to 0005000closed ocamldep misses dependencies 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2013-09-05 09:41 doligez Relationship added related to 0005000
2016-12-07 17:17 shinwell Category OCaml general => OCaml tools (ocaml{lex,yacc,dep,debug})
2016-12-07 17:17 shinwell Description Updated View Revisions

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker