Skip to content

Commit e0272d2

Browse files
committed
Partially revert "cache push on any thread"
This partially reverts commit 8a6b5e4 to restore `Node.cached` field.
1 parent d5084ec commit e0272d2

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

SCons/Node/NodeTests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,13 +1296,15 @@ def test_clear(self) -> None:
12961296
n.includes = 'testincludes'
12971297
n.Tag('found_includes', {'testkey':'testvalue'})
12981298
n.implicit = 'testimplicit'
1299+
n.cached = 1
12991300

13001301
x = MyExecutor()
13011302
n.set_executor(x)
13021303

13031304
n.clear()
13041305

13051306
assert n.includes is None, n.includes
1307+
assert n.cached == 0, n.cached
13061308
assert x.cleaned_up
13071309

13081310
def test_get_subst_proxy(self) -> None:

SCons/Node/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ def __init__(self) -> None:
588588
self.pseudo = False
589589
self.noclean = 0
590590
self.nocache = 0
591+
self.cached = 0 # is this node pulled from cache?
591592
self.always_build = None
592593
self.includes = None
593594
self.attributes = self.Attrs() # Generic place to stick information about the Node.
@@ -863,6 +864,7 @@ def clear(self) -> None:
863864
delattr(self, attr)
864865
except AttributeError:
865866
pass
867+
self.cached = 0
866868
self.includes = None
867869

868870
def clear_memoized_values(self) -> None:

SCons/Taskmaster/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ def execute(self):
246246
self.targets[0].build()
247247
for t in self.targets:
248248
t.push_to_cache()
249+
else:
250+
for t in cached_targets:
251+
t.cached = 1
249252
except SystemExit:
250253
exc_value = sys.exc_info()[1]
251254
raise SCons.Errors.ExplicitExit(self.targets[0], exc_value.code)

0 commit comments

Comments
 (0)