diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2013-10-27 11:46:41 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2013-10-27 11:46:41 (GMT) |
commit | e7888b15628b09af093621825b78df5cbcead088 (patch) | |
tree | 5c5a4afd7998be0a26cf3eb5636f5c5274cbddfd /src | |
parent | 5c7cea447b7f3b7833fbf4db25d32afa255cf52e (diff) | |
download | SCons-e7888b15628b09af093621825b78df5cbcead088.zip SCons-e7888b15628b09af093621825b78df5cbcead088.tar.gz SCons-e7888b15628b09af093621825b78df5cbcead088.tar.bz2 |
Correctly fix bug #2903, failure to rebuild when linker options change.
The failure to rebuild when linker options change was introduced in
abded0675444, "Add library version support to Shared Lib builder",
between 2.2.0 and 2.3.0.
Turning ShlinkAction into a FunctionAction instead of a CommandAction
made it stop depending on $SHLINKCOM. Normally, a CommandAction calls
get_presig (Action.py:815) which removes $( ... $) and uses the rest
of that string (recursively fully substituted) as the contents to
hash.
FunctionActions only look at the body of the function, so that removed
the dependency on $SHLINKCOM altogether. Adding it back in the
varlist does this (Action.py:443):
for v in vl:
result.append(env.subst('${'+v+'}'))
so it deep-substitutes the whole thing, including all the $( ... $)
parts. (All varlist vars do this, not just in FunctionActions.)
What we really want is to depend on the value of env['SHLINKCOM']
in the way CommandActions do, i.e. without the $( ... $)
parts, definitely not the fully substituted version of it.
I'm pretty sure the ignored $(...$) parts should not ever be
included in the signature, so this change updates the varlist handling
code to work the way CommandActions always have.
This change also renames the test files to use the correct bug
number and updates the test.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Action.py | 3 | ||||
-rw-r--r-- | src/engine/SCons/Tool/__init__.py | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index c1eef75..543c37c 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -439,7 +439,8 @@ class ActionBase(object): vl = self.get_varlist(target, source, env) if is_String(vl): vl = (vl,) for v in vl: - result.append(env.subst('${'+v+'}')) + # do the subst this way to ignore $(...$) parts: + result.append(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source)) return ''.join(result) def __add__(self, other): diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 7477f75..c09f8e4 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -364,8 +364,12 @@ symlinks for the platform we are on""" print "VerShLib: made sym link of %s -> %s" % (linkname, lib_ver) return result -# Fix http://scons.tigris.org/issues/show_bug.cgi?id=2903 : -# varlist=['$SHLINKCOM']: ensure we still depend on SCons.Defaults.ShLinkAction command line which is $SHLINKCOM +# Fix http://scons.tigris.org/issues/show_bug.cgi?id=2903 : +# Ensure we still depend on SCons.Defaults.ShLinkAction command line which is $SHLINKCOM. +# This was tricky because we don't want changing LIBPATH to cause a rebuild, but +# changing other link args should. LIBPATH has $( ... $) around it but until this +# fix, when the varlist was added to the build sig those ignored parts weren't getting +# ignored. ShLibAction = SCons.Action.Action(VersionedSharedLibrary, None, varlist=['SHLINKCOM']) def createSharedLibBuilder(env): |