summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt8
-rw-r--r--src/engine/SCons/Node/FS.py11
-rw-r--r--src/engine/SCons/Node/FSTests.py13
3 files changed, 29 insertions, 3 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index f4fa6ac..2824e8f 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -54,6 +54,14 @@ RELEASE 0.12 - XXX
- Don't silently swallow exceptions thrown by Scanners (or other
exceptions while finding a node's dependent children).
+ - Push files to CacheDir() before calling the superclass built()
+ method (which may clear the build signature as part of clearing
+ cached implicit dependencies, if the file has a source scanner).
+ (Bug reported by Jeff Petkau.)
+
+ - Raise an internal error if we attempt to push a file to CacheDir()
+ with a build signature of None.
+
From Lachlan O'Dea:
- Add SharedObject() support to the masm tool.
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index a6dd7ae..551ae06 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -1037,9 +1037,13 @@ class File(Entry):
SCons.Node.Node.build(self)
def built(self):
- SCons.Node.Node.built(self)
+ """Called just after this node is sucessfully built."""
+ # Push this file out to cache before the superclass Node.built()
+ # method has a chance to clear the build signature, which it
+ # will do if this file has a source scanner.
if self.fs.CachePath and os.path.exists(self.path):
CachePush(self, None, None)
+ SCons.Node.Node.built(self)
self.found_includes = {}
if hasattr(self, '_exists'):
delattr(self, '_exists')
@@ -1160,7 +1164,10 @@ class File(Entry):
def cachepath(self):
if self.fs.CachePath:
- bsig = str(self.get_bsig())
+ bsig = self.get_bsig()
+ if bsig is None:
+ raise SCons.Errors.InternalError, "cachepath(%s) found a bsig of None" % self.path
+ bsig = str(bsig)
subdir = string.upper(bsig[0])
dir = os.path.join(self.fs.CachePath, subdir)
return dir, os.path.join(dir, bsig)
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 5e4bb52..10e4676 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -1336,7 +1336,6 @@ class CacheDirTestCase(unittest.TestCase):
SCons.Node.FS.CacheRetrieveSilent = save_CacheRetrieveSilent
save_CachePush = SCons.Node.FS.CachePush
- self.pushed = []
def push(target, source, env, self=self):
self.pushed.append(target)
return 0
@@ -1345,6 +1344,8 @@ class CacheDirTestCase(unittest.TestCase):
try:
test = TestCmd(workdir='')
+ self.pushed = []
+
cd_f3 = test.workpath("cd.f3")
f3 = fs.File(cd_f3)
f3.built()
@@ -1375,6 +1376,16 @@ class CacheDirTestCase(unittest.TestCase):
filename = os.path.join(dirname, 'a_fake_bsig')
assert cp == (dirname, filename), cp
+ f6 = fs.File("cd.f6")
+ f5.set_bsig(None)
+ exc_caught = 0
+ try:
+ cp = f5.cachepath()
+ except SCons.Errors.InternalError:
+ exc_caught = 1
+ assert exc_caught
+
+
if __name__ == "__main__":
suite = unittest.TestSuite()