summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-10-02 12:24:41 (GMT)
committerSteven Knight <knight@baldmt.com>2001-10-02 12:24:41 (GMT)
commit3451935a570c186d36e020b7d48cf2dd3dc2be0b (patch)
tree2136634dfb2ef0c1f624d278731ac5554395e092
parent1287f392470ec9ef1a6be4f9a55ae67d7a638de8 (diff)
downloadSCons-3451935a570c186d36e020b7d48cf2dd3dc2be0b.zip
SCons-3451935a570c186d36e020b7d48cf2dd3dc2be0b.tar.gz
SCons-3451935a570c186d36e020b7d48cf2dd3dc2be0b.tar.bz2
Let the Taskmaster control whether the build stops.
-rw-r--r--src/engine/SCons/Job.py11
-rw-r--r--src/engine/SCons/JobTests.py4
2 files changed, 8 insertions, 7 deletions
diff --git a/src/engine/SCons/Job.py b/src/engine/SCons/Job.py
index 26031ff..f17c075 100644
--- a/src/engine/SCons/Job.py
+++ b/src/engine/SCons/Job.py
@@ -86,8 +86,9 @@ class Serial:
try:
task.execute()
except:
+ # Let the failed() callback function arrange for the
+ # build to stop if that's appropriate.
self.taskmaster.failed(task)
- return
else:
self.taskmaster.executed(task)
@@ -219,12 +220,10 @@ class Parallel:
finally:
cv.acquire()
except:
+ # Let the failed() callback function arrange for
+ # calling self.jobs.stop() to to stop the build
+ # if that's appropriate.
self.taskmaster.failed(task)
- # stop all jobs since there was a failure:
- # (this will wake up any waiting jobs, so
- # it isn't necessary to explicitly wake them
- # here)
- self.jobs.stop()
else:
self.taskmaster.executed(task)
diff --git a/src/engine/SCons/JobTests.py b/src/engine/SCons/JobTests.py
index f2189eb..b90ba1c 100644
--- a/src/engine/SCons/JobTests.py
+++ b/src/engine/SCons/JobTests.py
@@ -68,6 +68,7 @@ class Taskmaster:
"""n is the number of dummy tasks to perform."""
self.test_case = test_case
+ self.stop = None
self.num_tasks = n
self.num_iterated = 0
self.num_executed = 0
@@ -88,7 +89,7 @@ class Taskmaster:
def next_task(self):
- if self.all_tasks_are_iterated():
+ if self.stop or self.all_tasks_are_iterated():
return None
else:
self.num_iterated = self.num_iterated + 1
@@ -110,6 +111,7 @@ class Taskmaster:
def failed(self, task):
self.num_failed = self.num_failed + 1
+ self.stop = 1
def is_blocked(self):
# simulate blocking tasks