[Omake] scanning of .mly files

Jason Hickey jyh at cs.caltech.edu
Mon Jun 12 10:33:48 PDT 2006


Benjamin Pierce wrote:
> Now that others on the Harmony team are trying out my OMakefiles,  we're 
> seeing some strange behavior from OMake where dependencies are  being 
> calculated correctly on some people's machines and not on others.
> 
> Should .ml files be built automatically from .mly and .mll files  before 
> other ocaml files are scanned, or is this something that needs  to be 
> set up manually by calling OCamlGeneratedFiles?

This is a standing issue (and one we should highlight in big bold 
letters at the beginning of the OCaml section!)

The problem is that ocamldep ignores .mll and .mly files.  IMHO, this is 
a bug (see http://caml.inria.fr/mantis/view.php?id=3725 ).  In the 
meantime, you must explicitly block scanning until the corresponding .ml 
files are generated.

    # Block scanning globally until these files are generated
    OCamlGeneratedFiles(parser.ml parser.mli lexer.ml)

    # Block scanning only in this directory
    LocalOCamlGeneratedFiles(parser.ml parser.mli lexer.ml)

I'm not sure how to define a way to do this generically.  Maybe 
something like the following would specify, "If a foo.ml is in the 
project, and foo.mly exists, build foo.ml before scanning."

    .PREBUILD: %.ml: %.mly

> My reading of OCaml.om is that this will *not* happen automatically  -- 
> arguably it should.  But in any case, it seems strange that the  
> resulting behavior should differ from one machine to another.  Is  there 
> some way we can cause OMake to dump enough information to see  what the 
> difference might be?

Hmm, I'm not sure if you are using -k or such.  The build order is 
"nondetermistic".  Basically, the leaves of the build tree define a 
"ready-queue" of targets that can be built, and their order in the 
ready-queue is arbitrary.  However, if you are not using -k, and you 
start from a fresh tree, it _should_ be deterministic.

As far as debugging a lack of dependencies, it is hard:(  Erick, I 
believe, was suggesting that we monitor the filesystem and verify that 
file accesses conform to the dependency order.

Jason

-- 
Jason Hickey                  http://www.cs.caltech.edu/~jyh
Caltech Computer Science      Tel: 626-395-6568 FAX: 626-792-4257


More information about the Omake mailing list