summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-02-26 14:05:18 +0000
committerJonathan Maw <jonathan.maw@codethink.co.uk>2018-03-01 17:27:28 +0000
commit8a4fff9af391bea52397dbfcac907ab5759ef50c (patch)
tree3ff8251a659ed4ca0937b357c1e13e5d1b522dbd
parent2cbe1767f2dbfc3dcd57d11d9dd2301fff135ebf (diff)
downloadbuildstream-8a4fff9af391bea52397dbfcac907ab5759ef50c.tar.gz
scriptelement: Use built-in checks on runtime depends and sources
-rw-r--r--buildstream/scriptelement.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/buildstream/scriptelement.py b/buildstream/scriptelement.py
index ce9bf95b5..e71d4b7ac 100644
--- a/buildstream/scriptelement.py
+++ b/buildstream/scriptelement.py
@@ -53,6 +53,14 @@ class ScriptElement(Element):
#
BST_STRICT_REBUILD = True
+ # Script 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 set_work_dir(self, work_dir=None):
"""Sets the working dir
@@ -175,16 +183,6 @@ class ScriptElement(Element):
.format(self, item['element']))
def preflight(self):
- # All dependencies on script elements must be BUILD only, otherwise
- # the element will get pulled into dependencies
- if any(self.dependencies(Scope.RUN, recurse=False)):
- raise ElementError("{}: Only build type dependencies supported by script elements"
- .format(self))
-
- # Script elements have no use for sources, so they should not be present.
- if any(self.sources()):
- raise ElementError("{}: Script elements should not have sources".format(self))
-
# The layout, if set, must make sense.
self.__validate_layout()