summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-08-17 22:18:29 (GMT)
committerSteven Knight <knight@baldmt.com>2004-08-17 22:18:29 (GMT)
commitf7f7241f5bb9a93bf0aa9cf583b9ca19fc4f7e53 (patch)
tree10f3b934ade0574bcd58fd15434d6e0200daaaa0 /src/engine
parent483564c8512e0eaccadb2aebe03e7e928225063b (diff)
downloadSCons-f7f7241f5bb9a93bf0aa9cf583b9ca19fc4f7e53.zip
SCons-f7f7241f5bb9a93bf0aa9cf583b9ca19fc4f7e53.tar.gz
SCons-f7f7241f5bb9a93bf0aa9cf583b9ca19fc4f7e53.tar.bz2
Put back --implicit-cache, having it use the --debug=explain info instead of its own dependencies. (Anthony Roach)
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Node/FS.py10
-rw-r--r--src/engine/SCons/Node/__init__.py45
2 files changed, 28 insertions, 27 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index aa332c2..b10657c 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -1447,7 +1447,7 @@ 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:
+ 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.
#
@@ -1489,7 +1489,11 @@ class File(Base):
return BuildInfo()
def get_stored_implicit(self):
- return self.dir.sconsign().get_implicit(self.name)
+ binfo = self.get_stored_info()
+ try:
+ return binfo.bimplicit
+ except AttributeError:
+ return None
def get_found_includes(self, env, scanner, target):
"""Return the included implicit dependencies in this file.
@@ -1769,7 +1773,7 @@ class File(Base):
return csig
- def current(self, calc=None):
+ def current(self, calc=None, scan=1):
self.binfo = self.gen_binfo(calc)
if self.always_build:
return None
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index 603762e..be5e21c 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -419,27 +419,23 @@ class Node:
build_env = self.get_build_env()
- # XXX Here's where we implement --implicit-cache. This doesn't
- # do anything right now, but we're probably going to re-implement
- # as a way to cache #include lines from source files, so I want
- # to keep this code around for now.
- #
- #if implicit_cache and not implicit_deps_changed:
- # implicit = self.get_stored_implicit()
- # if implicit is not None:
- # implicit = map(self.implicit_factory, implicit)
- # self._add_child(self.implicit, self.implicit_dict, implicit)
- # calc = build_env.get_calculator()
- # if implicit_deps_unchanged or calc.current(self, calc.bsig(self)):
- # return
- # else:
- # # one of this node's sources has changed, so
- # # we need to recalculate the implicit deps,
- # # and the bsig:
- # self.implicit = []
- # self.implicit_dict = {}
- # self._children_reset()
- # self.del_binfo()
+ # Here's where we implement --implicit-cache.
+ if implicit_cache and not implicit_deps_changed:
+ implicit = self.get_stored_implicit()
+ if implicit is not None:
+ implicit = map(self.implicit_factory, implicit)
+ self._add_child(self.implicit, self.implicit_dict, implicit)
+ calc = build_env.get_calculator()
+ if implicit_deps_unchanged or self.current(calc, scan=0):
+ return
+ else:
+ # one of this node's sources has changed, so
+ # we need to recalculate the implicit deps,
+ # and the bsig:
+ self.implicit = []
+ self.implicit_dict = {}
+ self._children_reset()
+ self.del_binfo()
for child in self.children(scan=0):
scanner = self.get_source_scanner(child)
@@ -512,7 +508,7 @@ class Node:
self.binfo = self.gen_binfo(calc)
return self.binfo.bsig
- def gen_binfo(self, calc=None):
+ def gen_binfo(self, calc=None, scan=1):
"""
Generate a node's build signature, the digested signatures
of its dependency files and build information.
@@ -532,7 +528,8 @@ class Node:
binfo = self.new_binfo()
- self.scan()
+ if scan:
+ self.scan()
sources = self.filter_ignore(self.sources)
depends = self.filter_ignore(self.depends)
@@ -555,7 +552,7 @@ class Node:
bactsig = calc.module.signature(executor)
sigs.append(bactsig)
- if Save_Explain_Info:
+ if Save_Explain_Info or implicit_cache:
binfo.bsources = map(str, sources)
binfo.bdepends = map(str, depends)
binfo.bimplicit = map(str, implicit)