[Scons-users] writing your own decider

Dirk Bächle tshortik at gmx.de
Fri Apr 4 12:06:04 EDT 2014


On 04.04.2014 10:06, Tom Tanner (BLOOMBERG/ LONDON) wrote:

> I don't really understand why the decider would get called multiple

> times for the same dependency/target pair.

>

I understand that this is less than optimal for your current use case. I
looked at the sources again, and my guess would be that this was a
trade-off between "caching lots of decider results" vs. "calling the
(usually) fast decider function more than exactly one time".
It probably can be done differently, but this would require a lot of
thought and testing to get all the corner-cases right again.

Just some points that come to my head immediately:
The changed() method that actually calls the decider, is not only
responsible for checking whether all children are up-to-date. It also
has to check whether the node's own contents have changed.
So, if we are a header file "b.h" that gets included by other headers/C
files, on a first scan our contents didn't change. But during the
further processing, for some reason, our builder writes us with new
content (changed/added/removed). Now imagine another header file "f.h",
also including "b.h". If the target(s) that depend on "f.h" would cache
the results of the deciders, they couldn't detect the change anymore.

Dependency flows like this one, are the reason why SCons currently
regards it to be safer to throw away and rescan a lot of stuff, instead
of trying to figure out which nodes exactly get effected up the DAG and
have to be notified about the change.
Again, it might be more effective to do the latter but so far the
pressure hasn't been high enough for anyone to sit down, think it
through, and fight this beast down.

Regards,

Dirk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140404/36d4fb22/attachment.htm


More information about the Scons-users mailing list