From: stevenknight Date: Sat, 6 Dec 2003 14:02:46 +0000 (+0000) Subject: Prepare side-effect nodes before building, too. (Charles Crain) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c4859e9197044c5165df14b336418124026e8037;p=scons.git Prepare side-effect nodes before building, too. (Charles Crain) git-svn-id: http://scons.tigris.org/svn/scons/trunk@856 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index c9a4ad6e..b95cfc03 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -43,6 +43,9 @@ RELEASE 0.95 - XXX values. Previously, SCons would only use the values if all three were set in the registry. + - Make sure side-effect nodes are prepare()d before building their + corresponding target. + From Scott Lystig Fritchie: - Fix the ability to use a custom _concat() function in the diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py index b269fa2e..90d14528 100644 --- a/src/engine/SCons/Taskmaster.py +++ b/src/engine/SCons/Taskmaster.py @@ -81,6 +81,8 @@ class Task: for t in self.targets: t.prepare() + for s in t.side_effects: + s.prepare() def execute(self): """Called to execute the task. diff --git a/src/engine/SCons/TaskmasterTests.py b/src/engine/SCons/TaskmasterTests.py index fd21891e..019611a6 100644 --- a/src/engine/SCons/TaskmasterTests.py +++ b/src/engine/SCons/TaskmasterTests.py @@ -627,6 +627,28 @@ class TaskmasterTestCase(unittest.TestCase): assert str(e) == "exception value", e assert built_text is None, built_text + # Regression test, make sure we prepare not only + # all targets, but their side effects as well. + n6 = Node("n6") + n7 = Node("n7") + n8 = Node("n8") + n9 = Node("n9") + n10 = Node("n10") + + n6.side_effects = [ n8 ] + n7.side_effects = [ n9, n10 ] + + tm = SCons.Taskmaster.Taskmaster([n6, n7]) + t = tm.next_task() + # More bogus reaching in and setting the targets. + t.targets = [n6, n7] + t.prepare() + assert n6.prepared + assert n7.prepared + assert n8.prepared + assert n9.prepared + assert n10.prepared + def test_execute(self): """Test executing a task