Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004519OCamlOCaml generalpublic2008-03-11 00:442013-09-04 17:57
Reportermb 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version3.10.1 
Target VersionFixed in Version 
Summary0004519: Interior files handled in ocamldep
Descriptionocamldep does not emit dependencies for files which are not
found in the given search path. This is Ok for system files.
However for generated files (eg. via ocamllex or -yacc) this
places a burden on the build system. It has to take care
that all files are generated before the dependencies can be
calculated.

A simpler solution is to pass files interior to the build
graph to ocamldep. So whenever a module is encountered
which has no corresponding source it is checked whether
the file is given as interior file. If so, a dependency is
emited even though the file does not exists, yet. (It will
be later on created during the build process.)

The attached patch implements this change, however it is
very simple-minded and almost certainly needs polish.
Tagspatch
Attached Filesdiff file icon ocamldep.ml.diff [^] (2,113 bytes) 2008-03-11 00:44 [Show Content]

- Relationships
related to 0003725acknowledged Ocamldep should search for .mly & .mll files 

-  Notes
(0004473)
doligez (administrator)
2008-03-11 14:36

That doesn't solve your problem, because ocamldep will then be unable
to emit dependencies for the generated file, since it is missing.
Your dependencies will still be incomplete, so the value of this
new feature is rather doubtful.
(0004474)
mb (reporter)
2008-03-11 17:59

This is not true. Let me explain my point with an example.

I use the cook program to build my projects. Here I save the
dependency information in different files, which cook knows
how to (re-)generate them if necessary.

Suppose I have prog.ml and lexer.mll. I tell cook that it
should look out for prog.ml.d and lexer.ml.d, which contain
the dependency information. Since neither of them exists,
cook goes on and generates them. Depending on different
parameters cook might choose to do prog.ml.d first. Then it
tries to do lexer.mll.d, but there is no lexer.ml. No problem:
cook knows how to use ocamllex: First generate the .ml then
use ocamldep...

But now the build system is broken! ocamldep did not correctly
specify the dependency and the build will fail if cook tries
to build prog.cmo first.

My proposal fixes the problem. Without my proposal I have to
manually fiddle around with dependency information, which can
be easily obtained from the system. So the feature is clearly
useful.
(0004475)
frisch (developer)
2008-03-12 22:06

Why is the ocamldep's -modules option not enough?

- Issue History
Date Modified Username Field Change
2008-03-11 00:44 mb New Issue
2008-03-11 00:44 mb File Added: ocamldep.ml.diff
2008-03-11 14:36 doligez Note Added: 0004473
2008-03-11 14:36 doligez Status new => acknowledged
2008-03-11 17:59 mb Note Added: 0004474
2008-03-12 22:06 frisch Note Added: 0004475
2009-08-19 13:20 xclerc Relationship added related to 0003725
2013-09-04 17:57 doligez Tag Attached: patch


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker