Make .sconsign files get written even if the build fails or is terminated. (Anthony...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 11 Apr 2002 19:13:45 +0000 (19:13 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 11 Apr 2002 19:13:45 +0000 (19:13 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@328 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Node/__init__.py
src/engine/SCons/Script/__init__.py
src/engine/SCons/Taskmaster.py
test/errors.py

index f7de1c830a9b21f4223b695545ab0affef8da0d3..2207f3a29c34429ed10350c0e17a886881e7796e 100644 (file)
@@ -46,6 +46,9 @@ RELEASE 0.07 -
 
   - Added $SOURCE variable as a synonym for $SOURCES[0].
 
+  - Write out .sconsign files on error or interrupt so intermediate
+    build results are saved.
+
 
 
 RELEASE 0.06 - Thu, 28 Mar 2002 01:24:29 -0600
index cbaed7b5f2f89dc58ca06a3566db0c8d23356bfc..c8d5b2cc77049ab0ca180b3328b7f97b11f0a23b 100644 (file)
@@ -114,6 +114,8 @@ class Node:
 
     def built(self):
         """Called just after this node is sucessfully built."""
+        self.store_bsig()
+
         # Clear out the implicit dependency caches:
         # XXX this really should somehow be made more general and put
         #     under the control of the scanners.
index 308552ddf1f97ce20510b189e5513b6b4d7be7e6..813c363496b5fe7ebd7225bd6eee2f20aad31a7d 100644 (file)
@@ -827,10 +827,12 @@ def _main():
     taskmaster = SCons.Taskmaster.Taskmaster(nodes, task_class, calc)
 
     jobs = SCons.Job.Jobs(num_jobs, taskmaster)
-    jobs.start()
-    jobs.wait()
 
-    SCons.Sig.write()
+    try:
+        jobs.start()
+        jobs.wait()
+    finally:
+        SCons.Sig.write()
 
 def main():
     try:
index 7985b2e1e2da80e63f1bc57ed212335fccaf2f77..3fe96dae45f7c8da0a9134534e4466cd96956ce7 100644 (file)
@@ -90,7 +90,6 @@ class Task:
         if self.targets[0].get_state() == SCons.Node.executing:
             self.set_tstates(SCons.Node.executed)
             for t in self.targets:
-                t.store_bsig()
                 t.built()
 
         self.tm.executed(self.node)
index 1f582f7862f685527b8eef98e5f52d0b72edb328..9f1a83c97351a30c94cf14838259719ef8f7f40b 100644 (file)
@@ -26,9 +26,49 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import TestCmd
 import TestSCons
+import string
 
 test = TestSCons.TestSCons(match = TestCmd.match_re)
 
+test.write('foo.in', 'foo')
+test.write('exit.in', 'exit')
+test.write('SConstruct', """
+import sys
+
+def foo(env, target, source):
+    print str(target[0])
+    open(str(target[0]), 'wt').write('foo')
+
+def exit(env, target, source):
+    raise 'exit'
+
+env = Environment(BUILDERS = [Builder(name='foo', action=foo),
+                              Builder(name='exit', action=exit)])
+
+env.foo('foo.out', 'foo.in')
+env.exit('exit.out', 'exit.in')
+""")
+
+stderr = """scons: \*\*\* \[exit.out\] Exception
+Traceback \((most recent call|innermost) last\):
+  File ".+", line \d+, in .+
+    .+
+  File ".+", line \d+, in .+
+    .+
+  File ".+", line \d+, in .+
+    .+
+  File ".+", line \d+, in .+
+    .+
+.+
+"""
+
+test.run(arguments='foo.out exit.out', stderr=stderr, status=2)
+
+test.run(arguments='foo.out exit.out', stderr=stderr, status=2)
+assert string.find(test.stdout(), 'scons: "foo.out" is up to date.') != -1, test.stdout()
+
+
+
 test.write('SConstruct1', """
 a ! x
 """)