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 17:27:28 +0000
commit2cbe1767f2dbfc3dcd57d11d9dd2301fff135ebf (patch)
treeb173d625662a34c9a1b0189193d9cc17c246f46e
parentc333adf4faaf2d18c1bf9a5321f083d574a994f4 (diff)
downloadbuildstream-2cbe1767f2dbfc3dcd57d11d9dd2301fff135ebf.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,