[Scons-users] writing your own decider

Tom Tanner (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Fri Apr 4 04:06:13 EDT 2014


I don't really understand why the decider would get called multiple times for the same dependency/target pair.

Surely for any node A, with dependencies B, C, D

You'd check B was up to date, if not build it. Ditto, C. Ditto D.

Then you'd call the decider with A/B, A/C and A/D. You could optionally terminate the checks as soon as you found something wasn't up to date.

I was thinking if building B produced something that affected the dependencies of A - I'm not sure if that's possible (not even sure if currently it works), but even so as long as you keep checking the add dependencies are up to date, you still don't need to call the decider for A/B, A/C ... until you've finished this process.

Incidentally, I found out just now that if you are using a repository, dependency.exists() returns False, but dependency.rexists() returns True. This seems counter intuitive.

----- Original Message -----
From: dl9obn at darc.de
To: scons-users at scons.org
At: Apr 3 2014 20:13:32


Hi Tom,

On 03.04.2014 18:07, Tom Tanner (BLOOMBERG/ LONDON) wrote:


I've put some trace in my Decider
function and found it can be called twice for the same
dependency/target pair (at least on 2.2). Is that intentional?
And if so, why is it needed? Is it safe to cache the results if
the check is expensive?

the decider function is called from within changed(), which itself may get called several times during a build. I tried to cache the result of changed() for my memory reducing optimizations, but had to step it back a little, see:

http://two.pairlist.net/pipermail/scons-dev/2014-January/001034.html

(start of thread at http://two.pairlist.net/pipermail/scons-dev/2014-January/001009.html ). So, yes this is intentional and caching in the wrong places may lead to spurious rebuilds. However, if you can guarantee that neither the file (once it exists) nor one of its implicit dependencies changes anymore during the build, you should be able to cache the result of the decider.

Best regards,

Dirk

_______________________________________________ Scons-users mailing list Scons-users at scons.org http://four.pairlist.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140404/563582d5/attachment.html


More information about the Scons-users mailing list