[Scons-dev] please try latest default branch
Dirk Bächle
tshortik at gmx.de
Mon Jan 13 15:16:53 EST 2014
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
More information about the Scons-dev
mailing list