Boost logo

Boost-Build :

Subject: Re: [Boost-build] Call of interest
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-05-28 16:12:50


AMDG

Konstantin Litvinenko wrote:
> Vladimir Prus пишет:
>>>> How hard would it be to make Hammer compute MD5 signature of a.cpp
>>>> content and use *that* to decide if update is necessary.
>>> Hm. Don't know right now. Checker is separate part and has 150 LOC,
>>> so I
>>> think it is not to hard to implement another one. But I am curious why
>>> to use MD5 for that? I saw SCons do that, but don't get it why. Why use
>>> all this cryptographic and not relay on timestamp? Is there a *real*
>>> benefit?
>>
>> Well, if you change a file, save, and then realize the change is bad
>> idea and revert, you probably don't want a rebuild.
>
> I made a mistake and wait 1-5 secs to rebuild. But if build system
> will calculate md5 every time it is just wast of CPU cycles! I don't
> see any *real* benefit of doing that...

If you're already scanning the file for headers, I don't see that computing
a hash will significantly reduce processing speed, since processing the
file is most likely I/O bound anyway.

A few times I have run into the following.

a) modify a file
b) rebuild
c) copy an older version of the file over the current version
d) rebuild
e) nothing happens because the timestamp of the file doesn't reflect the
fact that it has changed.

Another case:
a) change a file
b) rebuild
c) change the file again before the next clock tick.
d) rebuild

This can happen when you have an automated script invoking
the build system multiple times, and the build is sufficiently fast.

In Christ,
Steven Watanabe


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk