[Omake] race condition in omake?

Aleksey Nogin nogin at metaprl.org
Thu Dec 21 09:44:12 PST 2006


On 21.12.2006 08:32, Nicholas Kidd wrote:

> Using omake, the following command sometimes fails and sometimes succeeds:
> 
> omake clean main
> 
> Basically, sometimes the file "main.cmi" is not built and compilation 
> fails.
> 
> Let me first state that I am relatively new to both ocaml and omake. So, 
> this may not be a bug, but my misunderstanding of how omake works when 
> multiple targets are supplied on the command line. Does omake attempt to 
> run them in parallel? 

Yes. OMake does global analysis of the build task and then would run all 
the rules that need to be ran in a fairly arbitrary order (within the 
constraints given by the dependencies, of course). The order in which 
things get specified on the command line (or in the dependencies list) 
does not have any significance in OMake.

If you really want to rebuild from scratch, you can use "omake clean; 
omake main". Or even "omake clean; omake -U --configure main".

Note, however, that none of this should be necessary. The OMake is 
designed to truly know when something needs to be rebuilt (with very few 
exceptions). If simply "omake main" is not doing what it is supposed to, 
then most likely there is a bug either in your OMakefiles (and that bug 
is likely to surface in other weird ways too) or in OMake (and than we'd 
appreciate knowing about it and will try to fix it). So, try "omake 
main" without any cleaning and please feel free to ask for help on the 
list if it is not working.

BTW, because OMake is only relying on the dependencies to make sure the 
build order is correct, OMake projects are fairly certain to still build 
correctly with a "-j nn" flag. I highly recommend adding a -j option to 
the OMAKEFLAGS environment variable, especially on multi-CPU machines.

Aleksey


More information about the Omake mailing list