diff options
author | Darius Makovsky <traveltissues@protonmail.com> | 2019-10-16 17:07:24 +0100 |
---|---|---|
committer | Darius Makovsky <traveltissues@protonmail.com> | 2019-10-16 17:07:24 +0100 |
commit | d7d602f96b84690222e977f16fc01959d1e97efa (patch) | |
tree | ec19471d0ccb2adac5180f92b02dec61ae0f4b35 | |
parent | 96164f5574c46d17bfa82198a2fe5e3bcb47b7ca (diff) | |
download | buildstream-d7d602f96b84690222e977f16fc01959d1e97efa.tar.gz |
wip
-rw-r--r-- | src/buildstream/element.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py index ef610bcc1..c41fa60b1 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -1129,11 +1129,12 @@ class Element(Plugin): # (bool): Whether this element is already present in # the artifact cache # - def _cached(self): + def _cached(self) -> None: if not self.__artifact: - return False - - return self.__artifact.cached() + self.__cached_successfully = False + return + if self.__artifact_cached(): + self.__cached_successfully = True # _cached_remotely(): # @@ -1176,16 +1177,15 @@ class Element(Plugin): # (bool): Whether this element is already present in # the artifact cache and the element assembled successfully # - def _cached_success(self): + def _cached_success(self) -> None: # FIXME: _cache() and _cached_success() should be converted to # push based functions where we only update __cached_successfully # once we know this has changed. This will allow us to cheaply check # __cached_successfully instead of calling _cached_success() if self.__cached_successfully: - return True + return - if not self._cached(): - return False + self._cached(): success, _, _ = self._get_build_result() if success: @@ -1609,7 +1609,7 @@ class Element(Plugin): self._update_state() self._update_ready_for_runtime_and_cached() - if self._get_workspace() and self._cached_success(): + if self._get_workspace() and self.__cached_successfully: assert utils._is_main_process(), \ "Attempted to save workspace configuration from child process" # @@ -1641,7 +1641,7 @@ class Element(Plugin): def _assemble(self): # Assert call ordering - assert not self._cached_success() + assert not self.__cached_successfully context = self._get_context() with self._output_file() as output_file: @@ -2319,7 +2319,7 @@ class Element(Plugin): # def _update_ready_for_runtime_and_cached(self): if not self.__ready_for_runtime_and_cached: - if self.__runtime_deps_uncached == 0 and self._cached_success() and \ + if self.__runtime_deps_uncached == 0 and self.__cached_successfully and \ self.__cache_key: self.__ready_for_runtime_and_cached = True |