From c4d35e362f544b427d400f4fb1f95da2236976ef Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Wed, 15 May 2002 21:26:08 +0000 Subject: Fix a --implicit-cache when a file has no implicit deps and its source is generated. (Anthony Roach) --- src/CHANGES.txt | 3 +++ src/engine/SCons/Sig/__init__.py | 4 ++-- test/option--implicit-cache.py | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 5dd578e..ad07cf7 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -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 diff --git a/src/engine/SCons/Sig/__init__.py b/src/engine/SCons/Sig/__init__.py index 386c9e5..40ee459 100644 --- a/src/engine/SCons/Sig/__init__.py +++ b/src/engine/SCons/Sig/__init__.py @@ -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') diff --git a/test/option--implicit-cache.py b/test/option--implicit-cache.py index 9a28271..704668b 100644 --- a/test/option--implicit-cache.py +++ b/test/option--implicit-cache.py @@ -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() -- cgit v0.12