[Scons-dev] please try latest default branch

Gary Oberbrunner garyo at oberbrunner.com
Tue Jan 14 08:44:23 EST 2014


OK, I'll try that. I guess the approach should be to set a new (temporary)
flag in the node when its executor is released, and then print a stack
trace if any node with that flag set gets its changed() method called?


On Mon, Jan 13, 2014 at 3:16 PM, Dirk Bächle <tshortik at gmx.de> wrote:


> On 13.01.2014 20:18, Gary Oberbrunner wrote:

>

>> Dirk, and others: I tracked down my spurious rebuild to the addition of

>> caching changed-status in File.changed() in Node/FS.py. If I remove that

>> caching code I don't get the rebuilds:

>>

>> diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py

>> --- a/src/engine/SCons/Node/FS.py

>> +++ b/src/engine/SCons/Node/FS.py

>> @@ -3043,13 +3043,15 @@

>> but we allow the return value to get cached after the reference

>> to the Executor got released in release_target_info().

>> """

>> - if node is None:

>> + allow_caching = False

>> + if node is None and allow_caching: # try this

>> try:

>> return self._memo['changed']

>> except KeyError:

>> pass

>> has_changed = SCons.Node.Node.changed(self, node)

>> + if allow_caching:

>> self._memo['changed'] = has_changed

>> return has_changed

>> I also had to add this code to fix an exception when the file doesn't

>> have an executor.

>>

>> diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__

>> init__.py

>> --- a/src/engine/SCons/Node/__init__.py

>> +++ b/src/engine/SCons/Node/__init__.py

>> @@ -1090,7 +1090,10 @@

>> if t: Trace(': %s changed' % child)

>> result = True

>> + if self.get_executor():

>> contents = self.get_executor().get_contents()

>> + else:

>> + contents = None

>> if self.has_builder():

>> import SCons.Util

>> newsig = SCons.Util.MD5signature(contents)

>>

>> Dirk, what do you think? I'll play with this version for a while.

>>

>>

> Okay, these both places are related by the call of

> SCons.Node.Node.changed() from SCons.Node.FS.File.changed() (one calls the

> other). What's supposed to happen is: in File.release_target_info() the

> executor gets released. Before this, the changed() method is called, such

> that it caches its value in self._memo['changed'].

> If this doesn't work as expected, this would mean the File.changed() gets

> called much later sometimes, after the executor got released *and* the

> self._memo was reset. Can you try and get a stacktrace for when that

> happens?

>

> It's crucial to be able to release the executor early...if we can't do it,

> there won't be much of a memory improvement.

>

> Regards,

>

> Dirk

>

>

>

> _______________________________________________

> Scons-dev mailing list

> Scons-dev at scons.org

> http://two.pairlist.net/mailman/listinfo/scons-dev

>




--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/scons-dev/attachments/20140114/49eeca0e/attachment.htm>


More information about the Scons-dev mailing list