[Omake] omake not rebuilding ocaml program if dependency changes

Aleksey Nogin nogin at metaprl.org
Tue Jan 2 17:14:16 PST 2007


On 02.01.2007 16:03, Erick Tryzelaar wrote:

>> Also, if you change the files in an "unimportant" way - that is change
>> the way code is formatted without affecting the binaries that the
>> compiler is producing, OMake is smart enough to know that the main
>> executable does not need to be rebuilt (as the binaries for the
>> individual modules stayed the same).
>>
>> Hope this helps.
>>   
> 
> Ah, thats it exactly :) I was only changing the formatting. I thought 
> omake just hashed the input files, not the output files as well. Does 
> omake do this for every file, not just ocaml files?

Yes, this is one of the basic premises of the OMake build algorithm - 
each target is rebuild if and only if one or more dependencies change. 
Contrary to how make does it, the text of the build command(s) is 
counted as a dependency, but the time stamps are ignored (*).

We also make the dependency computation steps into more explicit "full 
citizens" of the build process (dependency scanning rules are very 
similar to normal rules, can have dependencies of their own, etc). While 
the specific dependency scanner rules are obviously different for 
different languages, the underlying mechanism is the same across all of 
them.

Aleksey

(*) Well, while it does not change the outcome in any way, strictly 
speaking the time stamps are not completely ignored - they are used as 
an optimization. Namely, if the fstat data (time stamp, size, inode 
number, etc) of a file is _identical_ to what it was last time OMake 
looked at the file, we assume that the file did not change; if the fstat 
stuff differs, we compute the MD5 checksum (which is obviously much 
slower than fstat - this is BTW the "digests" statistic that OMake 
prints at the end) to find out whether the file is different. Note that 
we only compare time stamps for equality, but their "order" is never 
looked at, so things like clock skews over NFS are not a problem for us, 
like they are for make.


More information about the Omake mailing list