summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-08-17 22:59:44 (GMT)
committerSteven Knight <knight@baldmt.com>2004-08-17 22:59:44 (GMT)
commit401c24879c1dcd9e28df19b3ee2384b26df583ee (patch)
tree6020672dd780529908f2e7fdb10530400b1e0cfc /src/engine/SCons/Node
parentf7f7241f5bb9a93bf0aa9cf583b9ca19fc4f7e53 (diff)
downloadSCons-401c24879c1dcd9e28df19b3ee2384b26df583ee.zip
SCons-401c24879c1dcd9e28df19b3ee2384b26df583ee.tar.gz
SCons-401c24879c1dcd9e28df19b3ee2384b26df583ee.tar.bz2
Remove the misbegotten --save-explain-info feature.
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r--src/engine/SCons/Node/FS.py22
-rw-r--r--src/engine/SCons/Node/FSTests.py52
-rw-r--r--src/engine/SCons/Node/NodeTests.py13
-rw-r--r--src/engine/SCons/Node/__init__.py28
4 files changed, 11 insertions, 104 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index b10657c..7f0ca62 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -1447,29 +1447,9 @@ class File(Base):
# in one build (SConstruct file) is a source in a different build.
# See test/chained-build.py for the use case.
entry = self.get_stored_info()
- if not SCons.Node.Save_Explain_Info and not SCons.Node.implicit_cache:
- # If we're not saving explanation info, wipe out any that
- # might be in the already-stored entry.
- #
- # XXX This is kind of bad that we're naming attributes that
- # are really controlled in Node/__init__.py. It would be
- # good to find a way to move this logic there in some way
- # that still accounts for the fact that not all Node classes
- # need or use this information.
- attributes = [
- 'bsources', 'bsourcesigs',
- 'bdepends', 'bdependsigs',
- 'bimplicit', 'bimplicitsigs',
- 'bact', 'bactsig',
- ]
- for attr in attributes:
- try:
- delattr(entry, attr)
- except AttributeError:
- pass
for key, val in obj.__dict__.items():
entry.__dict__[key] = val
- sconsign = self.dir.sconsign().set_entry(self.name, entry)
+ self.dir.sconsign().set_entry(self.name, entry)
def get_stored_info(self):
try:
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index aba3481..c213d26 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -1973,57 +1973,6 @@ class SaveStringsTestCase(unittest.TestCase):
expect = map(os.path.normpath, ['src/f', 'd1/f', 'd0/b', 'd1/b'])
assert s == expect, s
-class SaveExplainInfoTestCase(unittest.TestCase):
- def runTest(self):
- """Test how we store --debug=explain info."""
- test=TestCmd(workdir='')
- fs = SCons.Node.FS.FS(test.workpath('fs'))
- f = fs.File('file')
-
- class BInfo:
- pass
-
- bi = BInfo()
- bi.bact = 'file bact'
- bi.arg1 = 'file arg1'
- f.store_info(bi)
-
- i = f.get_stored_info()
- assert i.bact == 'file bact', i.arg1
- assert i.arg1 == 'file arg1', i.arg1
- assert not hasattr(i, 'arg2'), i.bact
- assert not hasattr(i, 'arg3'), i.bact
-
- save_value = SCons.Node.Save_Explain_Info
- try:
- SCons.Node.Save_Explain_Info = 1
-
- bi = BInfo()
- bi.arg2 = 'file arg2'
- f.store_info(bi)
-
- i = f.get_stored_info()
- assert i.bact == 'file bact', i.arg1
- assert i.arg1 == 'file arg1', i.arg1
- assert i.arg2 == 'file arg2', i.arg2
- assert not hasattr(i, 'arg3'), i.bact
-
- SCons.Node.Save_Explain_Info = 0
-
- bi = BInfo()
- bi.arg3 = 'file arg3'
- f.store_info(bi)
-
- i = f.get_stored_info()
- assert not hasattr(i, 'bact'), i.bact
- assert i.arg1 == 'file arg1', i.arg1
- assert i.arg2 == 'file arg2', i.arg2
- assert i.arg3 == 'file arg3', i.arg2
- finally:
- SCons.Node.Save_Explain_Info = save_value
-
-
-
if __name__ == "__main__":
suite = unittest.TestSuite()
suite.addTest(FSTestCase())
@@ -2042,6 +1991,5 @@ if __name__ == "__main__":
suite.addTest(postprocessTestCase())
suite.addTest(SpecialAttrTestCase())
suite.addTest(SaveStringsTestCase())
- suite.addTest(SaveExplainInfoTestCase())
if not unittest.TextTestRunner().run(suite).wasSuccessful():
sys.exit(1)
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py
index 72ddd74..138b00b 100644
--- a/src/engine/SCons/Node/NodeTests.py
+++ b/src/engine/SCons/Node/NodeTests.py
@@ -416,19 +416,6 @@ class NodeTestCase(unittest.TestCase):
assert hasattr(binfo, 'bimplicitsigs')
assert binfo.bsig == 666, binfo.bsig
- SCons.Node.Save_Explain_Info = 0
-
- node = SCons.Node.Node()
- binfo = node.gen_binfo(Calculator(777))
- assert isinstance(binfo, SCons.Node.BuildInfo), binfo
- assert not hasattr(binfo, 'bsources')
- assert not hasattr(binfo, 'bsourcesigs')
- assert not hasattr(binfo, 'bdepends')
- assert not hasattr(binfo, 'bdependsigs')
- assert not hasattr(binfo, 'bimplicit')
- assert not hasattr(binfo, 'bimplicitsigs')
- assert binfo.bsig == 777, binfo.bsig
-
def test_explain(self):
"""Test explaining why a Node must be rebuilt
"""
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index be5e21c..0638375 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -76,9 +76,6 @@ implicit_deps_unchanged = 0
# controls whether the cached implicit deps are ignored:
implicit_deps_changed = 0
-# controls whether --debug=explain info is saved in Nodes:
-Save_Explain_Info = 1
-
# A variable that can be set to an interface-specific function be called
# to annotate a Node with information about its creation.
def do_nothing(node): pass
@@ -546,24 +543,19 @@ class Node:
sigs = sourcesigs + dependsigs + implicitsigs
- has_builder = self.has_builder()
- if has_builder:
+ if self.has_builder():
executor = self.get_executor()
- bactsig = calc.module.signature(executor)
- sigs.append(bactsig)
-
- if Save_Explain_Info or implicit_cache:
- binfo.bsources = map(str, sources)
- binfo.bdepends = map(str, depends)
- binfo.bimplicit = map(str, implicit)
+ binfo.bact = executor.get_contents()
+ binfo.bactsig = calc.module.signature(executor)
+ sigs.append(binfo.bactsig)
- binfo.bsourcesigs = sourcesigs
- binfo.bdependsigs = dependsigs
- binfo.bimplicitsigs = implicitsigs
+ binfo.bsources = map(str, sources)
+ binfo.bdepends = map(str, depends)
+ binfo.bimplicit = map(str, implicit)
- if has_builder:
- binfo.bact = executor.get_contents()
- binfo.bactsig = bactsig
+ binfo.bsourcesigs = sourcesigs
+ binfo.bdependsigs = dependsigs
+ binfo.bimplicitsigs = implicitsigs
binfo.bsig = calc.module.collect(filter(None, sigs))