summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-08-30 19:29:30 -0400
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-08-30 19:29:30 -0400
commit3ab23dbd4f01369727b3a7410c26f2f97ed7a340 (patch)
treef8483a2b6c851ea44df5fce85aa30bef8e3e86c4
parent2b0ba33947b920d0a91bf8391a2b00ec73d60096 (diff)
downloadbuildstream-3ab23dbd4f01369727b3a7410c26f2f97ed7a340.tar.gz
element.py and plugins: Changed Element.strict_rebuild API
Instead use BST_STRICT_REBUILD and follow a new pattern we're using for any class attributes used for the plugin to communicate static data back to the core.
-rw-r--r--buildstream/element.py4
-rw-r--r--buildstream/plugins/elements/compose.py6
-rw-r--r--buildstream/scriptelement.py6
3 files changed, 12 insertions, 4 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index a4b6e8857..b612b268e 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -103,7 +103,7 @@ class Element(Plugin):
artifact version.
"""
- strict_rebuild = False
+ BST_STRICT_REBUILD = False
"""Whether to rebuild this element in non strict mode if
any of the dependencies have changed.
"""
@@ -900,7 +900,7 @@ class Element(Plugin):
# Calculate weak cache key
# Weak cache key includes names of direct build dependencies
# but does not include keys of dependencies.
- if self.strict_rebuild:
+ if self.BST_STRICT_REBUILD:
dependencies = [
e._get_cache_key(strength=_KeyStrength.WEAK)
for e in self.dependencies(Scope.BUILD)
diff --git a/buildstream/plugins/elements/compose.py b/buildstream/plugins/elements/compose.py
index a090e7655..4d58c1ccc 100644
--- a/buildstream/plugins/elements/compose.py
+++ b/buildstream/plugins/elements/compose.py
@@ -41,7 +41,11 @@ from buildstream import Element, ElementError, Scope
# Element implementation for the 'compose' kind.
class ComposeElement(Element):
- strict_rebuild = True
+ # The compose element's output is it's dependencies, so
+ # we must rebuild if the dependencies change even when
+ # not in strict build plans.
+ #
+ BST_STRICT_REBUILD = True
def configure(self, node):
# We name this variable 'integration' only to avoid
diff --git a/buildstream/scriptelement.py b/buildstream/scriptelement.py
index 0bd8c0f7a..d84ca9157 100644
--- a/buildstream/scriptelement.py
+++ b/buildstream/scriptelement.py
@@ -43,7 +43,11 @@ class ScriptElement(Element):
__commands = None
__layout = []
- strict_rebuild = True
+ # The compose element's output is it's dependencies, so
+ # we must rebuild if the dependencies change even when
+ # not in strict build plans.
+ #
+ BST_STRICT_REBUILD = True
def set_work_dir(self, work_dir=None):
"""Sets the working dir