diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-01 19:35:35 -0400 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-09-01 20:21:48 -0400 |
commit | c9759ebbcbe548a514787e09a1e2b7dc5361ae15 (patch) | |
tree | 2e64dd728da0086caaa71826d2b4a368c1384540 /buildstream/source.py | |
parent | e54ab368e241c518015431251759013448196348 (diff) | |
download | buildstream-c9759ebbcbe548a514787e09a1e2b7dc5361ae15.tar.gz |
source.py: Consider directory when calculating cache key
NOTE: This commit changes cache keys for everything !
The core parses a 'directory' parameter which effects how all
sources are staged. This obviously changes the build but until now
this was ignored in cache key calculation.
Diffstat (limited to 'buildstream/source.py')
-rw-r--r-- | buildstream/source.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/buildstream/source.py b/buildstream/source.py index e0974228b..a4402963e 100644 --- a/buildstream/source.py +++ b/buildstream/source.py @@ -240,14 +240,22 @@ class Source(Plugin): else: self.stage(directory) - # Wrapper for get_unique_key() api that returns a key for a - # workspace if a workspace is active. + # Wrapper for get_unique_key() api + # + # This adds any core attributes to the key and + # also calculates something different if workspaces + # are active. # def _get_unique_key(self): + key = {} + + key['directory'] = self.__directory if self._has_workspace(): - return self._get_workspace_key() + key['workspace'] = self._get_workspace_key() else: - return self.get_unique_key() + key['unique'] = self.get_unique_key() + + return key # Wrapper for set_ref(), also returns whether it changed. # |