summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarius Makovsky <traveltissues@protonmail.com>2019-10-07 11:03:34 +0100
committerDarius Makovsky <traveltissues@protonmail.com>2019-10-07 11:03:34 +0100
commitaba467a6df566086274dfd93f4791b6f4a3279a1 (patch)
tree125b1856e6b590b81c85ab08ff64d9e8e17f1c0c
parent493fe615623cdb7010b725caea7e0b359dbe1940 (diff)
downloadbuildstream-aba467a6df566086274dfd93f4791b6f4a3279a1.tar.gz
wip
-rw-r--r--src/buildstream/element.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index ef610bcc1..fa0caf25a 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -1269,7 +1269,6 @@ class Element(Plugin):
def _update_state(self):
if not self._resolved_initial_state:
self._resolved_initial_state = True
- context = self._get_context()
# Compute and determine consistency of sources
self.__update_source_state()
@@ -1300,7 +1299,7 @@ class Element(Plugin):
return
- if not context.get_strict():
+ if not self._get_context().get_strict():
self.__update_cache_key_non_strict()
# _get_display_key():
@@ -3095,8 +3094,6 @@ class Element(Plugin):
# has changed.
#
def __update_cache_keys(self):
- context = self._get_context()
-
if self.__weak_cache_key is None:
# Calculate weak cache key
#
@@ -3132,7 +3129,7 @@ class Element(Plugin):
if self.__strict_cache_key is not None:
# In strict mode, the strong cache key always matches the strict cache key
- if context.get_strict():
+ if self._get_context().get_strict():
self.__cache_key = self.__strict_cache_key
# The Element may have just become ready for runtime now that the
@@ -3141,6 +3138,7 @@ class Element(Plugin):
else:
self.__update_strict_cache_key_of_rdeps()
+ ## FIXME: what does this do?
if self.__strict_cache_key is not None and self.__can_query_cache_callback is not None:
self.__can_query_cache_callback(self)
self.__can_query_cache_callback = None
@@ -3157,19 +3155,22 @@ class Element(Plugin):
def __update_artifact_state(self):
context = self._get_context()
- if not self.__weak_cache_key:
+ weak_key = self.__weak_cache_key or None
+ strong_key = self.__strict_cache_key or None
+
+ if not weak_key:
return
if not context.get_strict() and not self.__artifact:
# We've calculated the weak_key, so instantiate artifact instance member
- self.__artifact = Artifact(self, context, weak_key=self.__weak_cache_key)
+ self.__artifact = Artifact(self, context, weak_key=weak_key)
- if not self.__strict_cache_key:
+ if not strong_key:
return
if not self.__strict_artifact:
- self.__strict_artifact = Artifact(self, context, strong_key=self.__strict_cache_key,
- weak_key=self.__weak_cache_key)
+ self.__strict_artifact = Artifact(self, context, strong_key=strong_key,
+ weak_key=weak_key)
if context.get_strict():
self.__artifact = self.__strict_artifact
@@ -3264,6 +3265,8 @@ class Element(Plugin):
self.__cache_key is not None:
self.__ready_for_runtime = True
+## FIXME, this is the same as
+ ## def __update_strict_cache_key_of_rdeps(self):
# Notify reverse dependencies
for rdep in self.__reverse_runtime_deps:
rdep.__runtime_deps_without_cache_key -= 1
@@ -3284,6 +3287,7 @@ class Element(Plugin):
# now that we have the cache key, we are able to notify reverse dependencies
# that the element it ready. This is a likely trigger for workspaced elements.
self._update_ready_for_runtime_and_cached()
+ ## FIXME, this walks the rdeps A THIRD TIME! why........
def _overlap_error_detail(f, forbidden_overlap_elements, elements):