diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-04-11 22:11:11 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2018-04-11 14:10:55 +0000 |
commit | c94f1264014b7bb4110949bf326c500919f5534a (patch) | |
tree | eb543eecff05d9bf9f9ad59d28db1d201ab96c5d /buildstream/element.py | |
parent | 6ad88ecb3b5b465c4542a8dfdfc39386632319d1 (diff) | |
download | buildstream-c94f1264014b7bb4110949bf326c500919f5534a.tar.gz |
element.py, source.py: Cleanup how Source cache keys are calculated.
Recently after a refactor we kept the Source adding workspace keys
to the source keys because, now clean this up to have the workspace
key added directly in the Element cache key calculation.
This breaks cache keys.
Diffstat (limited to 'buildstream/element.py')
-rw-r--r-- | buildstream/element.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 0424b872b..091aaa19f 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -997,16 +997,6 @@ class Element(Plugin): project = self._get_project() workspace = self._get_workspace() - # Use the workspace key in source cache key calculations. - # - # This is only done this way to retain backwards compatibility - # of the cache key after making workspaces element wide instead - # of being source specific. - # - workspace_key = None - if workspace: - workspace_key = workspace.get_key() - self.__cache_key_dict = { 'artifact-version': "{}.{}".format(BST_CORE_ARTIFACT_VERSION, self.BST_ARTIFACT_VERSION), @@ -1015,7 +1005,8 @@ class Element(Plugin): 'element': self.get_unique_key(), 'execution-environment': self.__sandbox_config.get_unique_key(), 'environment': cache_env, - 'sources': [s._get_unique_key(workspace_key) for s in self.__sources], + 'sources': [s._get_unique_key(workspace is None) for s in self.__sources], + 'workspace': '' if workspace is None else workspace.get_key(), 'public': self.__public, 'cache': type(self.__artifacts).__name__ } |