Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003190OCamlOCaml generalpublic2004-09-29 05:112013-09-05 09:41
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionopen 
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: charter-242-009.caltech.edu (131.215.242.9)


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 x.ml and x.mli contain "open Y", and only y.ml 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)
that:
a) uses checksums to figure out when dependencies change and files need to be
rebuilt,
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 y.ml 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 x.cm* files might end up not being rebuilt when they should
be.

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 0005000resolved 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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker