[Top][All Lists]

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

Re: [gpsd-dev] Parallel build broken?

From: Eric S. Raymond
Subject: Re: [gpsd-dev] Parallel build broken?
Date: Tue, 26 Nov 2013 04:16:11 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

Gary E. Miller <address@hidden>:
> If we were doing this in make, we would just make the stuff that
> depends on leapsecond, depend on leapsecond.
> Something like this:
> all: leapsecond progs
> progs: 1stprog, 2ndprog, 3rdprog
> 1stprog: leapsecond
> Make then knows to get leapsecnd 1st, and can build 2ndprog and 3rdprog
> in parallel with that.  How to do that in scons is not something I have done.

It already works like this.  The only thing that depends on
leapsecond.cache is a generated file timebase.h, which is in turn
depended on by timebase.o only, which is depended on by libgpsd only. 
There's fan-out from libgpsd of course.

Presently timebase.h looks like this:

#define CENTURY_BASE    2000
#define LEAPSECOND_NOW  16

What makes scons different from - and better than - a Makefile is that
the "outdated" predicate is based on MD5 hashes of content rather than
file modification stamps.  Each time scons needs to decide whether to
rebuild timebase.o, for example, it does these steps:

Do I have a stored MD5 hash of the content of timebase.h?

If no, rebuild timebase.o. Hash timebase.h and store an association
from timebase.o to the hash. We're done.

If yes, fetch the stored hash of timebase.h; call that A. Hash the
current content of timebase.h; call it B.  If A = B we're done.

If A != B, rebuild timebase.o. Update its association to point
at B, not A.

The effect is that even through timebase.h is rewritten on every
call to, timebase.o is not rebuilt until LEAPSECOND_NOW
actually changes.
                <a href="";>Eric S. Raymond</a>

Attachment: signature.asc
Description: Digital signature

reply via email to

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