summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-04-17 10:58:18 +0200
committerJürg Billeter <j@bitron.ch>2019-04-17 10:58:18 +0200
commit59b6484a4e388deca2ad7bbb670c0df34547f3be (patch)
tree6a5ebd4e9fa65e8976afb9b1a55c010a0583925c
parentf78ec0d25e82fb4c7ce839afbacfbfae691293b1 (diff)
downloadbuildstream-juerg/955.tar.gz
WIP: Another Artifact cache key tweakjuerg/955
-rw-r--r--buildstream/_artifact.py9
-rw-r--r--buildstream/element.py2
2 files changed, 3 insertions, 8 deletions
diff --git a/buildstream/_artifact.py b/buildstream/_artifact.py
index 64b470e53..40c14b1c5 100644
--- a/buildstream/_artifact.py
+++ b/buildstream/_artifact.py
@@ -48,7 +48,7 @@ from .storage._casbaseddirectory import CasBasedDirectory
#
class Artifact():
- def __init__(self, element, context, *, strong_key=None, weak_key):
+ def __init__(self, element, context, *, strong_key=None, weak_key=None):
self._element = element
self._context = context
self._artifacts = context.artifactcache
@@ -95,12 +95,7 @@ class Artifact():
# (str): The key
#
def get_extract_key(self):
-
- context = self._context
-
- key = self._cache_key if context.get_strict() else self._weak_cache_key
-
- return key
+ return self._cache_key or self._weak_cache_key
# cache():
#
diff --git a/buildstream/element.py b/buildstream/element.py
index 543403353..3a327268a 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -738,7 +738,7 @@ class Element(Plugin):
context = self._get_context()
if self.__can_build_incrementally() and workspace.last_successful:
- last_successful = Artifact(self, context, strong_key=workspace.last_successful, weak_key=workspace.last_successful)
+ last_successful = Artifact(self, context, strong_key=workspace.last_successful)
old_dep_keys = last_successful.get_metadata_dependencies()
for dep in self.dependencies(scope):