From 08b719a71c01deea6cfc85c33c644d2872b07951 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sat, 7 Sep 2002 12:34:45 +0000 Subject: [PATCH] Fix -j with multiple targets. (Anthony Roach) git-svn-id: http://scons.tigris.org/svn/scons/trunk@459 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Taskmaster.py | 12 +++++++++--- test/option-j.py | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py index 799582bd..bf2d918c 100644 --- a/src/engine/SCons/Taskmaster.py +++ b/src/engine/SCons/Taskmaster.py @@ -231,12 +231,13 @@ class Taskmaster: if node is None: return None - self.executing.append(node) - self.executing.extend(node.side_effects) try: tlist = node.builder.targets(node) except AttributeError: tlist = [node] + self.executing.extend(tlist) + self.executing.extend(node.side_effects) + task = self.tasker(self, tlist, node in self.targets, node) task.make_ready() self.ready = None @@ -255,7 +256,12 @@ class Taskmaster: self.pending = [] def executed(self, node): - self.executing.remove(node) + try: + tlist = node.builder.targets(node) + except AttributeError: + tlist = [node] + for t in tlist: + self.executing.remove(t) for side_effect in node.side_effects: self.executing.remove(side_effect) diff --git a/test/option-j.py b/test/option-j.py index e67d3b40..b886afb1 100644 --- a/test/option-j.py +++ b/test/option-j.py @@ -51,11 +51,27 @@ file.write(str(time.time())) file.close() """) +test.subdir('foo') + +test.write(['foo','foo.in'], r""" +foo you +""") + test.write('SConstruct', """ MyBuild = Builder(action = r'%s build.py $TARGETS') env = Environment(BUILDERS = { 'MyBuild' : MyBuild }) env.MyBuild(target = 'f1', source = 'f1.in') env.MyBuild(target = 'f2', source = 'f2.in') + +def copyn(env, target, source): + import shutil + import time + time.sleep(1) + for t in target: + shutil.copy(str(source[0]), str(t)) + +t = env.Command(target=['foo/foo1.out', 'foo/foo2.out'], source='foo/foo.in', action=copyn) +env.Install('out', t) """ % python) def RunTest(args, extra): @@ -93,5 +109,7 @@ start2, finish1 = RunTest('f1 f2', "second") # before the first one was finished test.fail_test(start2 < finish1) +test.run(arguments='-j 2 out') + test.pass_test() -- 2.26.2