summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-02-22 13:00:16 +0000
committerJonathan Maw <jonathan.maw@codethink.co.uk>2018-03-01 12:48:35 +0000
commitb8fe98bd69f585889a543ccc81575dc86d175a21 (patch)
treef35a53cb9236cd0d33d06efcd10a822d3b508cae
parent3fb2b87e47f5259c6e77881ee53093754d3fd1a0 (diff)
downloadbuildstream-b8fe98bd69f585889a543ccc81575dc86d175a21.tar.gz
compose: Use built-in checks on runtime depends and sources
-rw-r--r--buildstream/plugins/elements/compose.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/buildstream/plugins/elements/compose.py b/buildstream/plugins/elements/compose.py
index 5d50b8433..3daebd8ae 100644
--- a/buildstream/plugins/elements/compose.py
+++ b/buildstream/plugins/elements/compose.py
@@ -47,6 +47,14 @@ class ComposeElement(Element):
#
BST_STRICT_REBUILD = True
+ # Compose artifacts must never have indirect dependencies,
+ # so runtime dependencies are forbidden.
+ BST_FORBID_RDEPENDS = True
+
+ # This element ignores sources, so we should forbid them from being
+ # added, to reduce the potential for confusion
+ BST_FORBID_SOURCES = True
+
def configure(self, node):
self.node_validate(node, [
'integrate', 'include', 'exclude', 'include-orphans'
@@ -60,17 +68,7 @@ class ComposeElement(Element):
self.include_orphans = self.node_get_member(node, bool, 'include-orphans')
def preflight(self):
- # Assert that the user did not list any runtime dependencies
- runtime_deps = list(self.dependencies(Scope.RUN, recurse=False))
- if runtime_deps:
- raise ElementError("{}: Only build type dependencies supported by compose elements"
- .format(self))
-
- # Assert that the user did not specify any sources, as they will
- # be ignored by this element type anyway
- sources = list(self.sources())
- if sources:
- raise ElementError("{}: Compose elements may not have sources".format(self))
+ pass
def get_unique_key(self):
key = {'integrate': self.integration,