Fix a --implicit-cache when a file has no implicit deps and its source is generated...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 15 May 2002 21:26:08 +0000 (21:26 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 15 May 2002 21:26:08 +0000 (21:26 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@374 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Sig/__init__.py
test/option--implicit-cache.py

index 5dd578e33363b45816f43944a7ab407c0f9d53ba..ad07cf7d73f353406d88b021e4a29633e095970b 100644 (file)
@@ -37,6 +37,9 @@ RELEASE 0.08 -
   - Fix --implicit-cache causing redundant rebuilds when the header
     file list changed.
 
+  - Fix --implicit-cache when a file has no implicit dependencies and
+    its source is generated.
+
   From Zed Shaw:
 
   - Add an Append() method to Environments, to append values to
index 386c9e50aedccbc9a3a1fa76d3675d1fa7d2e1a2..40ee459dfea12017bab91625b1107b2c6fe0d35a 100644 (file)
@@ -82,13 +82,13 @@ class SConsignEntry:
         return '%s %s %s %s' % (timestamp, bsig, csig, implicit)
 
     def get_implicit(self):
-        if self.implicit is None:
+        if not self.implicit:
             return None
         else:
             return string.split(self.implicit, '\0')
 
     def set_implicit(self, implicit):
-        if implicit is None:
+        if not implicit:
             self.implicit = None
         else:
             self.implicit = string.join(map(str, implicit), '\0')
index 9a28271b947f7217d954e4c4405f9c186183fd05..704668b883e28cfa3fe46a57951a9f302b6460c6 100644 (file)
@@ -53,6 +53,11 @@ BuildDir('variant', 'subdir', 0)
 include = Dir('include')
 env = Environment(CPPPATH=['inc2', include])
 SConscript('variant/SConscript', "env")
+
+def copy(target, source, env):
+    open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read())
+nodep = env.Command('nodeps.c', 'nodeps.in', action=copy)
+env.Program('nodeps', 'nodeps.c')
 """)
 
 test.write(['subdir', 'SConscript'],
@@ -61,6 +66,17 @@ Import("env")
 env.Program(target='prog', source='prog.c')
 """)
 
+test.write('nodeps.in', 
+r"""
+int
+main(int argc, char *argv[])
+{
+    argv[argc++] = "--";
+    return 0;
+}
+""")
+
+
 test.write(['include', 'foo.h'],
 r"""
 #define        FOO_STRING "include/foo.h 1\n"
@@ -223,4 +239,8 @@ test.run(program = test.workpath(subdir_prog),
 test.run(program = test.workpath(variant_prog),
          stdout = "subdir/prog.c\ninclude/foo.h 3\ninclude/bar.h 1\n")
 
+# test in the face of a file with no dependencies where the source file is generated:
+test.run(arguments = "--implicit-cache nodeps%s"%_exe)
+
+
 test.pass_test()