[Scons-users] writing your own decider
Dirk Bächle
tshortik at gmx.de
Thu Apr 3 15:13:10 EDT 2014
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140403/29bc7730/attachment.html
More information about the Scons-users
mailing list