diff options
author | Steven Knight <knight@baldmt.com> | 2004-08-17 22:59:44 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-08-17 22:59:44 (GMT) |
commit | 401c24879c1dcd9e28df19b3ee2384b26df583ee (patch) | |
tree | 6020672dd780529908f2e7fdb10530400b1e0cfc /src | |
parent | f7f7241f5bb9a93bf0aa9cf583b9ca19fc4f7e53 (diff) | |
download | SCons-401c24879c1dcd9e28df19b3ee2384b26df583ee.zip SCons-401c24879c1dcd9e28df19b3ee2384b26df583ee.tar.gz SCons-401c24879c1dcd9e28df19b3ee2384b26df583ee.tar.bz2 |
Remove the misbegotten --save-explain-info feature.
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 10 | ||||
-rw-r--r-- | src/engine/SCons/Node/FS.py | 22 | ||||
-rw-r--r-- | src/engine/SCons/Node/FSTests.py | 52 | ||||
-rw-r--r-- | src/engine/SCons/Node/NodeTests.py | 13 | ||||
-rw-r--r-- | src/engine/SCons/Node/__init__.py | 28 | ||||
-rw-r--r-- | src/engine/SCons/Script/__init__.py | 8 |
6 files changed, 16 insertions, 117 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 9d21296..e8b3af1 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,7 +8,10 @@ r __COPYRIGHT__ -RELEASE 0.96 - XXX +RELEASE 0.95 - XXX + + NOTE: This is a pre-release of 0.96 for testing purposes. When 0.96 + is released, all these changes will be listed as 0.96 changes. From Chad Austin: @@ -97,11 +100,6 @@ RELEASE 0.96 - XXX - Add a --debug=explain option that reports the reason(s) why SCons thinks it must rebuild something. - - Add --save-explain-info and SetOption('save_explain_info') options - to control whether the --debug=explain information is saved in - the .sconsign file(s). Not saving this information can improve - performance and save memory usage. - - Add support for functions that return platform-independent Actions to Chmod(), Copy(), Delete(), Mkdir(), Move() and Touch() files and/or directories. Like any other Actions, the returned Action 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)) diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 87e9602..51d3e66 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -620,10 +620,6 @@ class OptParser(OptionParser): self.add_option('-s', '--silent', '--quiet', action="store_true", default=0, help="Don't print commands.") - self.add_option('--save-explain-info', type="int", action="store", - dest='save_explain_info', metavar='0|1', - help="(Don't) save --debug=explain information") - self.add_option('-u', '--up', '--search-up', action="store_const", dest="climb_up", default=0, const=1, help="Search up directory tree for SConstruct, " @@ -731,8 +727,7 @@ class SConscriptSettableOptions: 'max_drift':SCons.Sig.default_max_drift, 'implicit_cache':0, 'clean':0, - 'duplicate':'hard-soft-copy', - 'save_explain_info':1} + 'duplicate':'hard-soft-copy'} def get(self, name): if not self.settable.has_key(name): @@ -945,7 +940,6 @@ def _main(args, parser): # that are SConscript settable: SCons.Node.implicit_cache = ssoptions.get('implicit_cache') SCons.Node.FS.set_duplicate(ssoptions.get('duplicate')) - SCons.Node.Save_Explain_Info = ssoptions.get('save_explain_info') or print_explanations lookup_top = None if targets: |