bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #46242] Race condition when input file is updated while compili


From: David Boyce
Subject: Re: [bug #46242] Race condition when input file is updated while compiling
Date: Wed, 21 Oct 2015 06:08:56 -0700

On Tue, Oct 20, 2015 at 2:07 PM, Mike Shal <address@hidden> wrote:
> I would clarify that the benefit from using the technique in that article is
> really because the rebuild algorithm is essentially changed from:
>
> if timestamp(foo.o) < timestamp(foo.c) {rebuild foo.o}
>
> to:
>
> if checksum(foo.c) != last_checksum(foo.c) {rebuild things that depend on
> foo.c}
>
> But you can get pretty much all the same benefits without having to hash
> everything just by doing:
>
> if timestamp(foo.c) != last_timestamp(foo.c) {rebuild things that depend on
> foo.c}

Yes, that’s a good point and it would be somewhat cheaper than
hashing. However, the main concern with either approach doesn’t
involve the cost of hashing source files but the complexity of
preserving state between builds. As you know make is currently
“stateless”, or maybe it’s better to say the only state required is
already held in file inodes without any special intervention required
from make. Adding either feature would require metadata describing the
prior state (whether checksums or timestamps) to be saved from build
to build which opens up many complications and corner cases, some as
noted by Reiner Post.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]