diff options
| author | Steven Knight <knight@baldmt.com> | 2003-01-27 03:55:51 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2003-01-27 03:55:51 (GMT) |
| commit | 078be7b37ba947064d07ac85969f1bd5f3c8ae27 (patch) | |
| tree | bb2dcbd756279f2004eeb24e3ba47bd32511e3c2 /src/engine/SCons/Taskmaster.py | |
| parent | fb4152bf88a71d44c6ec7627d63dae6b93ee348a (diff) | |
| download | SCons-078be7b37ba947064d07ac85969f1bd5f3c8ae27.zip SCons-078be7b37ba947064d07ac85969f1bd5f3c8ae27.tar.gz SCons-078be7b37ba947064d07ac85969f1bd5f3c8ae27.tar.bz2 | |
Provide a better error message when a BuildDir() is read-only.
Diffstat (limited to 'src/engine/SCons/Taskmaster.py')
| -rw-r--r-- | src/engine/SCons/Taskmaster.py | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py index 645c7df..10f074f 100644 --- a/src/engine/SCons/Taskmaster.py +++ b/src/engine/SCons/Taskmaster.py @@ -74,6 +74,13 @@ class Task: so only do thread safe stuff here. Do thread unsafe stuff in prepare(), executed() or failed().""" try: + # We recorded an exception while getting this Task ready + # for execution. Raise it now. + raise self.node.exc_type, self.node.exc_value + except AttributeError: + # The normal case: no exception to raise. + pass + try: self.targets[0].build() except KeyboardInterrupt: raise @@ -198,7 +205,18 @@ class Taskmaster: # keep track of which nodes are in the execution stack: node.set_state(SCons.Node.stack) - children = node.children() + try: + children = node.children() + except: + # We had a problem just trying to figure out the + # children (like a child couldn't be linked in to a + # BuildDir). Arrange to raise the exception when the + # Task is "executed." + node.exc_type = sys.exc_type + node.exc_value = sys.exc_value + self.candidates.pop() + self.ready = node + break # detect dependency cycles: def in_stack(node): return node.get_state() == SCons.Node.stack @@ -236,10 +254,11 @@ class Taskmaster: node.set_state(SCons.Node.pending) self.candidates.pop() continue - else: - self.candidates.pop() - self.ready = node - break + + # The default when we've gotten through all of the checks above. + self.candidates.pop() + self.ready = node + break def next_task(self): """Return the next task to be executed.""" @@ -259,7 +278,15 @@ class Taskmaster: self.executing.extend(node.side_effects) task = self.tasker(self, tlist, node in self.targets, node) - task.make_ready() + try: + task.make_ready() + except: + # We had a problem just trying to get this task ready (like + # a child couldn't be linked in to a BuildDir when deciding + # whether this node is current). Arrange to raise the + # exception when the Task is "executed." + node.exc_type = sys.exc_type + node.exc_value = sys.exc_value self.ready = None return task |
