summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-05-18 05:12:35 (GMT)
committerSteven Knight <knight@baldmt.com>2008-05-18 05:12:35 (GMT)
commit61173c84a9f0535b47b21b9c2623dc5f853d9ca0 (patch)
tree97e2df9b08fd971d661d41e0ce1bc169c4d7efa7 /src
parent64daa285c6d9089cd74a988d5512f2007bf7254f (diff)
downloadSCons-61173c84a9f0535b47b21b9c2623dc5f853d9ca0.zip
SCons-61173c84a9f0535b47b21b9c2623dc5f853d9ca0.tar.gz
SCons-61173c84a9f0535b47b21b9c2623dc5f853d9ca0.tar.bz2
Merged revisions 2928-2932,2934-2946 via svnmerge from
http://scons.tigris.org/svn/scons/branches/core ........ r2932 | garyo | 2008-04-30 09:14:38 -0700 (Wed, 30 Apr 2008) | 1 line Add doc for site_scons dir and related options. Closes issue #1996. ........ r2934 | stevenknight | 2008-04-30 22:05:38 -0700 (Wed, 30 Apr 2008) | 3 lines Issue 2039: Fix a syntax error in Intel C compiler support on Windows. (Jonas Olsson) ........ r2935 | belley | 2008-05-01 06:59:21 -0700 (Thu, 01 May 2008) | 10 lines test/KeyboardInterrupt.py no longer hangs under Cygwin. There seems to be a bug on Cygwin where the compiler process hangs after sending the SIGINT signal to the process group. It is probably a bug in cygwin1.dll, or maybe in the Python 'C' code or the Python subprocess module. We therefore do not use 'killpg' on Cygwin. Benoit ........ r2936 | belley | 2008-05-01 07:10:23 -0700 (Thu, 01 May 2008) | 12 lines cell_contents not defined in python < 2.5. [Issue 2035] Some versions of Python supports lexical scoping of local variables (aka closures) but not the cell_contents attribute that would allow the FunctionAction signature that take the content of these closure cells into account. The access to the cell_contents attribute is now protected with a try/except AttributeError so that at least the other parts of the function signature are properly computed. Benoit ........ r2937 | stevenknight | 2008-05-01 12:08:25 -0700 (Thu, 01 May 2008) | 3 lines When running tests, allow the user to set the $SCONSIGN variable to pick a specific sconsign script to execute. ........ r2938 | stevenknight | 2008-05-02 19:13:14 -0700 (Fri, 02 May 2008) | 2 lines Set svn:ignore to '*.py[co]'. ........ r2939 | stevenknight | 2008-05-08 21:07:18 -0700 (Thu, 08 May 2008) | 4 lines Issue 2033: Fix excessive memory use when a Python Value node's representation is stored in a .sconsign file and then re-stored after being interpreted with escaped backslashes and quotes. ........ r2940 | cournape | 2008-05-16 03:56:49 -0700 (Fri, 16 May 2008) | 1 line Fix issue 2054. ........ r2941 | stevenknight | 2008-05-16 12:02:45 -0700 (Fri, 16 May 2008) | 8 lines Issue 2045: After a Node has failed its build and we're propagating the failure to other Nodes on the candidate list, don't marke candidate Nodes as FAILED if they've already been visited and been determined to be up-to-date. This avoids problems with Configure tests not running because failure of an earlier Configure tests caused (e.g.) /usr/bin/g++ to get marked as FAILED, making SCons think it doesn't need to bother trying to rebuild anything that will use it... ........ r2942 | stevenknight | 2008-05-16 12:10:14 -0700 (Fri, 16 May 2008) | 8 lines Improve the regular expressions used by the test infrastructure to examine SCons output to decide if a list of targets are considered up-to-date or not. The new code uses the re.escape() function instead of hand-escaping '.' and '\n'. This required a little restructuring in the not_up_to_date() method to escape the characters within the arguments themselves, but not the surrounding characters we use to construct the regex that makes sure those strings *don't* exist in the output. ........ r2943 | stevenknight | 2008-05-16 14:04:23 -0700 (Fri, 16 May 2008) | 3 lines Issue 2049: Handle multiple pipe-separated values in Visual Studio for INCLUDE, LIB and PATH. Still only uses Win32, not any other values. ........ r2944 | stevenknight | 2008-05-16 18:36:27 -0700 (Fri, 16 May 2008) | 2 lines Record changes by David Cournapeau and Benoit Belley. ........ r2945 | stevenknight | 2008-05-17 07:13:46 -0700 (Sat, 17 May 2008) | 3 lines Pass in dc as a keyword argument to _smartLink for older Python versions without nested scopes. ........ r2946 | stevenknight | 2008-05-17 07:14:01 -0700 (Sat, 17 May 2008) | 3 lines Expect a warning about shadowing global variables on Python 2.1. (This code can go away after we release 1.0.) ........
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt30
-rw-r--r--src/engine/SCons/Action.py13
-rw-r--r--src/engine/SCons/ActionTests.py30
-rw-r--r--src/engine/SCons/Node/Alias.py3
-rw-r--r--src/engine/SCons/Node/FS.py3
-rw-r--r--src/engine/SCons/Node/Python.py5
-rw-r--r--src/engine/SCons/Taskmaster.py15
-rw-r--r--src/engine/SCons/Tool/dmd.py2
-rw-r--r--src/engine/SCons/Tool/g77.py4
-rw-r--r--src/engine/SCons/Tool/intelc.py2
-rw-r--r--src/engine/SCons/Tool/msvc.py35
-rw-r--r--src/script/sconsign.py4
12 files changed, 104 insertions, 42 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 57cafa5..5a780b5 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -8,6 +8,36 @@
+RELEASE 0.98.4 - XXX
+
+ From Benoit Belley:
+
+ - Fix calculation of signatures for Python function actions with
+ closures in Python versions before 2.5.
+
+ From David Cournapeau:
+
+ - Fix the initialization of $SHF77FLAGS so it includes $F77FLAGS.
+
+ From Jonas Olsson:
+
+ - Fix a syntax error in the Intel C compiler support on Windows.
+
+ From Steven Knight:
+
+ - Change how we represent Python Value Nodes when printing and when
+ stored in .sconsign files (to avoid blowing out memory by storing
+ huge strings in .sconsign files after multiple runs using Configure
+ contexts cause the Value strings to be re-escaped each time).
+
+ - Fix a regression in not executing configuration checks after failure
+ of any configuration check that used the same compiler or other tool.
+
+ - Handle multiple destinations in Visual Studio 8 settings for the
+ analogues to the INCLUDE, LIBRARY and PATH variables.
+
+
+
RELEASE 0.98.3 - Tue, 29 Apr 2008 22:40:12 -0700
From Greg Noel:
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py
index d2211b7..1bc9baac 100644
--- a/src/engine/SCons/Action.py
+++ b/src/engine/SCons/Action.py
@@ -277,7 +277,10 @@ def _function_contents(func):
closure = []
#xxx = [_object_contents(x.cell_contents) for x in closure]
- xxx = map(lambda x: _object_contents(x.cell_contents), closure)
+ try:
+ xxx = map(lambda x: _object_contents(x.cell_contents), closure)
+ except AttributeError:
+ xxx = []
contents.append(',(' + string.join(xxx, ',') + ')')
return string.join(contents, '')
@@ -809,7 +812,13 @@ class FunctionAction(_ActionAction):
return c
def array(a):
def quote(s):
- return '"' + str(s) + '"'
+ try:
+ str_for_display = s.str_for_display
+ except AttributeError:
+ s = repr(s)
+ else:
+ s = str_for_display()
+ return s
return '[' + string.join(map(quote, a), ", ") + ']'
try:
strfunc = self.execfunction.strfunction
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py
index a503981..2fb3b06 100644
--- a/src/engine/SCons/ActionTests.py
+++ b/src/engine/SCons/ActionTests.py
@@ -172,6 +172,8 @@ class Environment:
class DummyNode:
def __init__(self, name):
self.name = name
+ def str_for_display(self):
+ return '"' + self.name + '"'
def __str__(self):
return self.name
def rfile(self):
@@ -432,10 +434,10 @@ class _ActionActionTestCase(unittest.TestCase):
result = a("out", "in", env)
assert result.status == 7, result
s = sio.getvalue()
- assert s == 'execfunc(["out"], ["in"])\n', s
+ assert s == "execfunc(['out'], ['in'])\n", s
a.chdir = 'xyz'
- expect = 'os.chdir(%s)\nexecfunc(["out"], ["in"])\nos.chdir(%s)\n'
+ expect = "os.chdir(%s)\nexecfunc(['out'], ['in'])\nos.chdir(%s)\n"
sio = StringIO.StringIO()
sys.stdout = sio
@@ -458,7 +460,7 @@ class _ActionActionTestCase(unittest.TestCase):
result = b("out", "in", env)
assert result.status == 7, result.status
s = sio.getvalue()
- assert s == 'firstfunc(["out"], ["in"])\nexecfunc(["out"], ["in"])\n', s
+ assert s == "firstfunc(['out'], ['in'])\nexecfunc(['out'], ['in'])\n", s
SCons.Action.execute_actions = 0
@@ -467,14 +469,14 @@ class _ActionActionTestCase(unittest.TestCase):
result = a("out", "in", env)
assert result == 0, result
s = sio.getvalue()
- assert s == 'execfunc(["out"], ["in"])\n', s
+ assert s == "execfunc(['out'], ['in'])\n", s
sio = StringIO.StringIO()
sys.stdout = sio
result = b("out", "in", env)
assert result == 0, result
s = sio.getvalue()
- assert s == 'firstfunc(["out"], ["in"])\nexecfunc(["out"], ["in"])\nlastfunc(["out"], ["in"])\n', s
+ assert s == "firstfunc(['out'], ['in'])\nexecfunc(['out'], ['in'])\nlastfunc(['out'], ['in'])\n", s
SCons.Action.print_actions_presub = 1
SCons.Action.execute_actions = 1
@@ -484,35 +486,35 @@ class _ActionActionTestCase(unittest.TestCase):
result = a("out", "in", env)
assert result.status == 7, result.status
s = sio.getvalue()
- assert s == 'Building out with action:\n execfunc(target, source, env)\nexecfunc(["out"], ["in"])\n', s
+ assert s == "Building out with action:\n execfunc(target, source, env)\nexecfunc(['out'], ['in'])\n", s
sio = StringIO.StringIO()
sys.stdout = sio
result = a("out", "in", env, presub=0)
assert result.status == 7, result.status
s = sio.getvalue()
- assert s == 'execfunc(["out"], ["in"])\n', s
+ assert s == "execfunc(['out'], ['in'])\n", s
sio = StringIO.StringIO()
sys.stdout = sio
result = a("out", "in", env, presub=1)
assert result.status == 7, result.status
s = sio.getvalue()
- assert s == 'Building out with action:\n execfunc(target, source, env)\nexecfunc(["out"], ["in"])\n', s
+ assert s == "Building out with action:\n execfunc(target, source, env)\nexecfunc(['out'], ['in'])\n", s
sio = StringIO.StringIO()
sys.stdout = sio
result = b(["out"], "in", env, presub=1)
assert result.status == 7, result.status
s = sio.getvalue()
- assert s == 'Building out with action:\n firstfunc(target, source, env)\nfirstfunc(["out"], ["in"])\nBuilding out with action:\n execfunc(target, source, env)\nexecfunc(["out"], ["in"])\n', s
+ assert s == "Building out with action:\n firstfunc(target, source, env)\nfirstfunc(['out'], ['in'])\nBuilding out with action:\n execfunc(target, source, env)\nexecfunc(['out'], ['in'])\n", s
sio = StringIO.StringIO()
sys.stdout = sio
result = b(["out", "list"], "in", env, presub=1)
assert result.status == 7, result.status
s = sio.getvalue()
- assert s == 'Building out and list with action:\n firstfunc(target, source, env)\nfirstfunc(["out", "list"], ["in"])\nBuilding out and list with action:\n execfunc(target, source, env)\nexecfunc(["out", "list"], ["in"])\n', s
+ assert s == "Building out and list with action:\n firstfunc(target, source, env)\nfirstfunc(['out', 'list'], ['in'])\nBuilding out and list with action:\n execfunc(target, source, env)\nexecfunc(['out', 'list'], ['in'])\n", s
a2 = SCons.Action.Action(execfunc)
@@ -521,14 +523,14 @@ class _ActionActionTestCase(unittest.TestCase):
result = a2("out", "in", env)
assert result.status == 7, result.status
s = sio.getvalue()
- assert s == 'Building out with action:\n execfunc(target, source, env)\nexecfunc(["out"], ["in"])\n', s
+ assert s == "Building out with action:\n execfunc(target, source, env)\nexecfunc(['out'], ['in'])\n", s
sio = StringIO.StringIO()
sys.stdout = sio
result = a2("out", "in", env, presub=0)
assert result.status == 7, result.status
s = sio.getvalue()
- assert s == 'execfunc(["out"], ["in"])\n', s
+ assert s == "execfunc(['out'], ['in'])\n", s
SCons.Action.execute_actions = 0
@@ -537,7 +539,7 @@ class _ActionActionTestCase(unittest.TestCase):
result = a2("out", "in", env, presub=0)
assert result == 0, result
s = sio.getvalue()
- assert s == 'execfunc(["out"], ["in"])\n', s
+ assert s == "execfunc(['out'], ['in'])\n", s
sio = StringIO.StringIO()
sys.stdout = sio
@@ -568,7 +570,7 @@ class _ActionActionTestCase(unittest.TestCase):
result.append(s)
env['PRINT_CMD_LINE_FUNC'] = my_print_cmd_line
a("output", "input", env)
- assert result == ['execfunc(["output"], ["input"])'], result
+ assert result == ["execfunc(['output'], ['input'])"], result
finally:
diff --git a/src/engine/SCons/Node/Alias.py b/src/engine/SCons/Node/Alias.py
index bb23d3f..93558f9 100644
--- a/src/engine/SCons/Node/Alias.py
+++ b/src/engine/SCons/Node/Alias.py
@@ -74,6 +74,9 @@ class Alias(SCons.Node.Node):
SCons.Node.Node.__init__(self)
self.name = name
+ def str_for_display(self):
+ return '"' + self.__str__() + '"'
+
def __str__(self):
return self.name
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index bd8b564..b154e34 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -544,6 +544,9 @@ class Base(SCons.Node.Node):
self.cwd = None # will hold the SConscript directory for target nodes
self.duplicate = directory.duplicate
+ def str_for_display(self):
+ return '"' + self.__str__() + '"'
+
def must_be_same(self, klass):
"""
This node, which already existed, is being looked up as the
diff --git a/src/engine/SCons/Node/Python.py b/src/engine/SCons/Node/Python.py
index 7cdea14..741d7e9 100644
--- a/src/engine/SCons/Node/Python.py
+++ b/src/engine/SCons/Node/Python.py
@@ -56,9 +56,12 @@ class Value(SCons.Node.Node):
if not built_value is None:
self.built_value = built_value
- def __str__(self):
+ def str_for_display(self):
return repr(self.value)
+ def __str__(self):
+ return str(self.value)
+
def make_ready(self):
self.get_csig()
diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py
index 6f93ca7..27dd1f0 100644
--- a/src/engine/SCons/Taskmaster.py
+++ b/src/engine/SCons/Taskmaster.py
@@ -529,7 +529,7 @@ class Taskmaster:
while self.candidates:
candidates = self.candidates
self.candidates = []
- self.will_not_build(candidates)
+ self.will_not_build(candidates, lambda n: n.state < NODE_UP_TO_DATE)
return None
def _find_next_ready_node(self):
@@ -634,6 +634,9 @@ class Taskmaster:
# take a stab at evaluating them (or their children).
children_not_visited.reverse()
self.candidates.extend(self.order(children_not_visited))
+ #if T and children_not_visited:
+ # T.write('Taskmaster: adding to candidates: %s\n' % map(str, children_not_visited))
+ # T.write('Taskmaster: candidates now: %s\n' % map(str, self.candidates))
# Skip this node if any of its children have failed.
#
@@ -731,7 +734,7 @@ class Taskmaster:
return task
- def will_not_build(self, nodes):
+ def will_not_build(self, nodes, mark_fail=lambda n: n.state != NODE_FAILED):
"""
Perform clean-up about nodes that will never be built.
"""
@@ -742,8 +745,8 @@ class Taskmaster:
for node in nodes:
# Set failure state on all of the parents that were dependent
# on this failed build.
- if node.state != NODE_FAILED:
- node.state = NODE_FAILED
+ if mark_fail(node):
+ node.set_state(NODE_FAILED)
parents = node.waiting_parents
to_visit = to_visit | parents
pending_children = pending_children - parents
@@ -759,8 +762,8 @@ class Taskmaster:
to_visit.remove(node)
else:
break
- if node.state != NODE_FAILED:
- node.state = NODE_FAILED
+ if mark_fail(node):
+ node.set_state(NODE_FAILED)
parents = node.waiting_parents
to_visit = to_visit | parents
pending_children = pending_children - parents
diff --git a/src/engine/SCons/Tool/dmd.py b/src/engine/SCons/Tool/dmd.py
index a173162..53432c6 100644
--- a/src/engine/SCons/Tool/dmd.py
+++ b/src/engine/SCons/Tool/dmd.py
@@ -194,7 +194,7 @@ def generate(env):
env['SMART_LINKCOM'] = smart_link[linkcom]
except KeyError:
def _smartLink(source, target, env, for_signature,
- defaultLinker=linkcom):
+ defaultLinker=linkcom, dc=dc):
if isD(source):
try:
libs = env['LIBS']
diff --git a/src/engine/SCons/Tool/g77.py b/src/engine/SCons/Tool/g77.py
index 058b061..66d3d89 100644
--- a/src/engine/SCons/Tool/g77.py
+++ b/src/engine/SCons/Tool/g77.py
@@ -48,8 +48,8 @@ def generate(env):
env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS')
env['SHF77FLAGS'] = SCons.Util.CLVar('$F77FLAGS')
else:
- env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$SHFORTRANFLAGS -fPIC')
- env['SHF77FLAGS'] = SCons.Util.CLVar('$SHF77FLAGS -fPIC')
+ env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS -fPIC')
+ env['SHF77FLAGS'] = SCons.Util.CLVar('$F77FLAGS -fPIC')
env['FORTRAN'] = fcomp
env['SHFORTRAN'] = '$FORTRAN'
diff --git a/src/engine/SCons/Tool/intelc.py b/src/engine/SCons/Tool/intelc.py
index db5d06e..020a6f7 100644
--- a/src/engine/SCons/Tool/intelc.py
+++ b/src/engine/SCons/Tool/intelc.py
@@ -394,7 +394,7 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0):
if version is None:
version = ''
# Each path has a registry entry, use that or default to subdir
- for p in paths.keys():
+ for p in paths:
try:
path=get_intel_registry_value(p[1], version, abi)
# These paths may have $(ICInstallDir)
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py
index a1067c0..1a42d62 100644
--- a/src/engine/SCons/Tool/msvc.py
+++ b/src/engine/SCons/Tool/msvc.py
@@ -203,6 +203,11 @@ def _parse_msvc8_overrides(version,platform,suite):
user_settings = doc.getElementsByTagName('UserSettings')[0]
tool_options = user_settings.getElementsByTagName('ToolsOptions')[0]
tool_options_categories = tool_options.getElementsByTagName('ToolsOptionsCategory')
+ environment_var_map = {
+ 'IncludeDirectories' : 'INCLUDE',
+ 'LibraryDirectories' : 'LIBRARY',
+ 'ExecutableDirectories' : 'PATH',
+ }
for category in tool_options_categories:
category_name = category.attributes.get('name')
if category_name is not None and category_name.value == 'Projects':
@@ -215,21 +220,21 @@ def _parse_msvc8_overrides(version,platform,suite):
property_name = property.attributes.get('name')
if property_name is None:
continue
- elif property_name.value == 'IncludeDirectories':
- include_dirs = property.childNodes[0].data
- # ToDo: Support for other destinations than Win32
- include_dirs = include_dirs.replace('Win32|', '')
- dirs['INCLUDE'] = include_dirs
- elif property_name.value == 'LibraryDirectories':
- lib_dirs = property.childNodes[0].data.replace('Win32|', '')
- # ToDo: Support for other destinations than Win32
- lib_dirs = lib_dirs.replace('Win32|', '')
- dirs['LIBRARY'] = lib_dirs
- elif property_name.value == 'ExecutableDirectories':
- path_dirs = property.childNodes[0].data.replace('Win32|', '')
- # ToDo: Support for other destinations than Win32
- path_dirs = path_dirs.replace('Win32|', '')
- dirs['PATH'] = path_dirs
+ var_name = environment_var_map.get(property_name)
+ if var_name:
+ data = property.childNodes[0].data
+ value_list = string.split(data, '|')
+ if len(value_list) == 1:
+ dirs[var_name] = value_list[0]
+ else:
+ while value_list:
+ dest, value = value_list[:2]
+ del value_list[:2]
+ # ToDo: Support for destinations
+ # other than Win32
+ if dest == 'Win32':
+ dirs[var_name] = value
+ break
else:
# There are no default directories in the registry for VS8 Express :(
raise SCons.Errors.InternalError, "Unable to find MSVC paths in the registry."
diff --git a/src/script/sconsign.py b/src/script/sconsign.py
index 2aebf85..7591069 100644
--- a/src/script/sconsign.py
+++ b/src/script/sconsign.py
@@ -274,6 +274,8 @@ def nodeinfo_raw(name, ninfo, prefix=""):
l = []
for k in keys:
l.append('%s: %s' % (repr(k), repr(d.get(k))))
+ if '\n' in name:
+ name = repr(name)
return name + ': {' + string.join(l, ', ') + '}'
def nodeinfo_cooked(name, ninfo, prefix=""):
@@ -282,6 +284,8 @@ def nodeinfo_cooked(name, ninfo, prefix=""):
except AttributeError:
field_list = []
f = lambda x, ni=ninfo, v=Verbose: field(x, ni, v)
+ if '\n' in name:
+ name = repr(name)
outlist = [name+':'] + filter(None, map(f, field_list))
if Verbose:
sep = '\n ' + prefix