summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-12-15 04:10:39 (GMT)
committerSteven Knight <knight@baldmt.com>2004-12-15 04:10:39 (GMT)
commit4acaf8f30a96e70821fcc21a687206cd8c683a98 (patch)
tree80455273d537403d77e86264e5ae140a7d262526 /src
parenta62d56bcb2780eba0f1f47d867c7a519cc766131 (diff)
downloadSCons-4acaf8f30a96e70821fcc21a687206cd8c683a98.zip
SCons-4acaf8f30a96e70821fcc21a687206cd8c683a98.tar.gz
SCons-4acaf8f30a96e70821fcc21a687206cd8c683a98.tar.bz2
Use the right scanner if the same source file is used for targets in two different environments.
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt6
-rw-r--r--src/engine/SCons/Node/FS.py5
-rw-r--r--src/engine/SCons/Node/FSTests.py8
3 files changed, 17 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index fe0f879..41a96ce 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -330,6 +330,12 @@ RELEASE 0.97 - XXX
- Fix command-line expansion of Python Value Nodes.
+ - Internal cleanups: Remove an unnecessary scan argument. Associate
+ Scanners only with Builders, not nodes.
+
+ - Use the correct scanner if the same source file is used for targets in
+ two different environments with the same path but different scanners.
+
From Levi Stephen:
- Allow $JARCHDIR to be expanded to other construction variables.
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index bc9e682..1af739f 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -1497,11 +1497,12 @@ class File(Base):
path = scanner.path(env, target.cwd)
target.scanner_paths[scanner] = path
+ key = str(id(env)) + '|' + str(id(scanner)) + '|' + string.join(map(str,path), ':')
try:
- includes = self.found_includes[path]
+ includes = self.found_includes[key]
except KeyError:
includes = scanner(self, env, path)
- self.found_includes[path] = includes
+ self.found_includes[key] = includes
return includes
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 747fdf1..5ed377c 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -909,6 +909,14 @@ class FSTestCase(unittest.TestCase):
assert deps == [xyz], deps
assert s.call_count == 2, s.call_count
+ env2 = Environment()
+
+ deps = f12.get_found_includes(env2, s, t1)
+ assert deps == [xyz], deps
+ assert s.call_count == 3, s.call_count
+
+
+
# Make sure we can scan this file even if the target isn't
# a file that has a scanner (it might be an Alias, e.g.).
class DummyNode: