diff options
author | Darius Makovsky <traveltissues@protonmail.com> | 2019-09-05 14:33:51 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-09-24 15:58:25 +0000 |
commit | b9e2af22bc94d108a27fc9a40f698b4822c7118e (patch) | |
tree | 50206c7e4be6072afc8b51636c0014a47710400d /src | |
parent | e25da0391352c596d26fe892f3435c38133c500a (diff) | |
download | buildstream-b9e2af22bc94d108a27fc9a40f698b4822c7118e.tar.gz |
element.py: always check sources for caching
Check that sources are cached even if they are workspaced and do not
reset workspace cache data
partially reverts !1470
closes #1088
element.py: remove workspaces in cache key calc
Using the workspace source plugin, workspaces should now be handled like
sources for the purpose of calculating element cache keys.
partially reverts !1470
works towards #1073
Since the source keys are now calculated using the unique keys of the
workspace source, this change will break external tracking for open
workspaces. In future attempting to track an open workspace might raise
a SourceError. The test is rewritten to close the workspace before
tracking.
Diffstat (limited to 'src')
-rw-r--r-- | src/buildstream/element.py | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py index 711723ebe..0ad2da17f 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -1279,10 +1279,6 @@ class Element(Plugin): # Tracking may still be pending return - if self._get_workspace() and self.__assemble_scheduled: - self.__reset_cache_data() - return - self.__update_cache_keys() self.__update_artifact_state() @@ -2236,7 +2232,6 @@ class Element(Plugin): } project = self._get_project() - workspace = self._get_workspace() self.__cache_key_dict = { 'core-artifact-version': BST_CORE_ARTIFACT_VERSION, @@ -2252,15 +2247,9 @@ class Element(Plugin): return {'key': _source._get_unique_key(True), 'name': _source._get_source_name()} - def __get_workspace_entry(workspace): - return {'key': workspace.get_key()} - - if workspace is None: - self.__cache_key_dict['sources'] = \ - [__get_source_entry(s) for s in self.__sources] - else: - self.__cache_key_dict['sources'] = \ - [__get_workspace_entry(workspace)] + self._source_cached() + self.__cache_key_dict['sources'] = \ + [__get_source_entry(s) for s in self.__sources] self.__cache_key_dict['fatal-warnings'] = sorted(project._fatal_warnings) @@ -2271,7 +2260,7 @@ class Element(Plugin): # Check if sources are cached, generating the source key if it hasn't been def _source_cached(self): - if self.__sources and not self._get_workspace(): + if self.__sources: sourcecache = self._get_context().sourcecache # Go through sources we'll cache generating keys |