Hi Gary,

On 02.02.2014 23:13, Gary Oberbrunner wrote:
HA -- got a small repro testcase!

[...]

Run that twice as "scons all-defuns.obj". The second time _shouldn't_ rebuild anything, but it will re-run the Copy command. SCons 2.3.0 correctly doesn't do anything the second time.


looks like I found a solution. The problem is that "changed()" gets called in different contexts: not only within make_ready_current/release_target_info after building a target, but also during scanning with a call stack like this:

            changed [FS.py:3052]
            is_up_to_date [FS.py:3121]
            current_check [__init__.py:309]
            __call__ [__init__.py:203]
            get_found_includes [FS.py:2684]
            get_implicit_deps [__init__.py:586]
            scan [Executor.py:474]
            scan_sources [Executor.py:455]

Please find a patch attached and try it on your large build if you find the time. I've added an "allowcache" argument to the "changed()" method, that gets only set in the release_target_info path.
This let's your simple testcase pass on my side...

If you can confirm that this brings your build back to working properly, I'd create a pull request for this fix.

Regards,

Dirk

diff -r d53323337b3a src/engine/SCons/Node/FS.py
--- a/src/engine/SCons/Node/FS.py	Sun Jan 05 13:27:10 2014 +0100
+++ b/src/engine/SCons/Node/FS.py	Wed Feb 12 00:21:29 2014 +0100
@@ -2779,7 +2779,7 @@
         if not hasattr(self.attributes, 'keep_targetinfo'):
             # Cache some required values, before releasing
             # stuff like env, executor and builder...
-            self.changed()
+            self.changed(allowcache=True)
             self.get_contents_sig()
             self.get_build_env()
             # Now purge unneeded stuff to free memory...
@@ -3034,7 +3034,7 @@
              
             self.scanner_paths = None
 
-    def changed(self, node=None):
+    def changed(self, node=None, allowcache=False):
         """
         Returns if the node is up-to-date with respect to the BuildInfo
         stored last time it was built. 
@@ -3050,7 +3050,8 @@
                 pass
         
         has_changed = SCons.Node.Node.changed(self, node)
-        self._memo['changed'] = has_changed
+        if allowcache:
+            self._memo['changed'] = has_changed
         return has_changed
 
     def changed_content(self, target, prev_ni):
diff -r d53323337b3a src/engine/SCons/Node/__init__.py
--- a/src/engine/SCons/Node/__init__.py	Sun Jan 05 13:27:10 2014 +0100
+++ b/src/engine/SCons/Node/__init__.py	Wed Feb 12 00:21:29 2014 +0100
@@ -1049,7 +1049,7 @@
     def Decider(self, function):
         SCons.Util.AddMethod(self, function, 'changed_since_last_build')
 
-    def changed(self, node=None):
+    def changed(self, node=None, allowcache=False):
         """
         Returns if the node is up-to-date with respect to the BuildInfo
         stored last time it was built.  The default behavior is to compare
_______________________________________________
Scons-dev mailing list
[email protected]
http://two.pairlist.net/mailman/listinfo/scons-dev

Reply via email to