summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-12-13 18:50:48 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-12-13 14:23:19 +0000
commit4c0e602c5273fecac4583f854082983281d85cc6 (patch)
treeba7fc34b1853c6423b7c69639461cabe1b7dc570
parent3a6d27a435db5778272557e60cecb6147773f6e6 (diff)
downloadbuildstream-4c0e602c5273fecac4583f854082983281d85cc6.tar.gz
BuildElement: Don't enable batching of prepare and assemble by default
Some external plugins depend derive from BuildElement and are broken by BuildElement enabling this batching by default. Instead, enable it in all of the individual build element plugin implementations. This fixes issue #800
-rw-r--r--buildstream/buildelement.py4
-rw-r--r--buildstream/plugins/elements/autotools.py8
-rw-r--r--buildstream/plugins/elements/cmake.py8
-rw-r--r--buildstream/plugins/elements/distutils.py8
-rw-r--r--buildstream/plugins/elements/make.py8
-rw-r--r--buildstream/plugins/elements/makemaker.py8
-rw-r--r--buildstream/plugins/elements/manual.py8
-rw-r--r--buildstream/plugins/elements/meson.py8
-rw-r--r--buildstream/plugins/elements/modulebuild.py8
-rw-r--r--buildstream/plugins/elements/pip.py8
-rw-r--r--buildstream/plugins/elements/qmake.py8
11 files changed, 70 insertions, 14 deletions
diff --git a/buildstream/buildelement.py b/buildstream/buildelement.py
index 06c623590..6ef060f12 100644
--- a/buildstream/buildelement.py
+++ b/buildstream/buildelement.py
@@ -215,10 +215,6 @@ class BuildElement(Element):
# Setup environment
sandbox.set_environment(self.get_environment())
- # Enable command batching across prepare() and assemble()
- self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
- collect=self.get_variable('install-root'))
-
def stage(self, sandbox):
# Stage deps in the sandbox root
diff --git a/buildstream/plugins/elements/autotools.py b/buildstream/plugins/elements/autotools.py
index 43fe7add4..2243a73f9 100644
--- a/buildstream/plugins/elements/autotools.py
+++ b/buildstream/plugins/elements/autotools.py
@@ -55,7 +55,7 @@ See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
details on common configuration options for build elements.
"""
-from buildstream import BuildElement
+from buildstream import BuildElement, SandboxFlags
# Element implementation for the 'autotools' kind.
@@ -63,6 +63,12 @@ class AutotoolsElement(BuildElement):
# Supports virtual directories (required for remote execution)
BST_VIRTUAL_DIRECTORY = True
+ # Enable command batching across prepare() and assemble()
+ def configure_sandbox(self, sandbox):
+ super().configure_sandbox(sandbox)
+ self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
+ collect=self.get_variable('install-root'))
+
# Plugin entry point
def setup():
diff --git a/buildstream/plugins/elements/cmake.py b/buildstream/plugins/elements/cmake.py
index de9aa9616..a1bea0cd6 100644
--- a/buildstream/plugins/elements/cmake.py
+++ b/buildstream/plugins/elements/cmake.py
@@ -54,7 +54,7 @@ See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
details on common configuration options for build elements.
"""
-from buildstream import BuildElement
+from buildstream import BuildElement, SandboxFlags
# Element implementation for the 'cmake' kind.
@@ -62,6 +62,12 @@ class CMakeElement(BuildElement):
# Supports virtual directories (required for remote execution)
BST_VIRTUAL_DIRECTORY = True
+ # Enable command batching across prepare() and assemble()
+ def configure_sandbox(self, sandbox):
+ super().configure_sandbox(sandbox)
+ self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
+ collect=self.get_variable('install-root'))
+
# Plugin entry point
def setup():
diff --git a/buildstream/plugins/elements/distutils.py b/buildstream/plugins/elements/distutils.py
index d6b500938..94d7a9705 100644
--- a/buildstream/plugins/elements/distutils.py
+++ b/buildstream/plugins/elements/distutils.py
@@ -31,7 +31,7 @@ See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
details on common configuration options for build elements.
"""
-from buildstream import BuildElement
+from buildstream import BuildElement, SandboxFlags
# Element implementation for the python 'distutils' kind.
@@ -39,6 +39,12 @@ class DistutilsElement(BuildElement):
# Supports virtual directories (required for remote execution)
BST_VIRTUAL_DIRECTORY = True
+ # Enable command batching across prepare() and assemble()
+ def configure_sandbox(self, sandbox):
+ super().configure_sandbox(sandbox)
+ self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
+ collect=self.get_variable('install-root'))
+
# Plugin entry point
def setup():
diff --git a/buildstream/plugins/elements/make.py b/buildstream/plugins/elements/make.py
index a22de168a..262dc2b3f 100644
--- a/buildstream/plugins/elements/make.py
+++ b/buildstream/plugins/elements/make.py
@@ -36,7 +36,7 @@ See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
details on common configuration options for build elements.
"""
-from buildstream import BuildElement
+from buildstream import BuildElement, SandboxFlags
# Element implementation for the 'make' kind.
@@ -44,6 +44,12 @@ class MakeElement(BuildElement):
# Supports virtual directories (required for remote execution)
BST_VIRTUAL_DIRECTORY = True
+ # Enable command batching across prepare() and assemble()
+ def configure_sandbox(self, sandbox):
+ super().configure_sandbox(sandbox)
+ self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
+ collect=self.get_variable('install-root'))
+
# Plugin entry point
def setup():
diff --git a/buildstream/plugins/elements/makemaker.py b/buildstream/plugins/elements/makemaker.py
index 17deb66d4..c3161581a 100644
--- a/buildstream/plugins/elements/makemaker.py
+++ b/buildstream/plugins/elements/makemaker.py
@@ -31,7 +31,7 @@ See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
details on common configuration options for build elements.
"""
-from buildstream import BuildElement
+from buildstream import BuildElement, SandboxFlags
# Element implementation for the 'makemaker' kind.
@@ -39,6 +39,12 @@ class MakeMakerElement(BuildElement):
# Supports virtual directories (required for remote execution)
BST_VIRTUAL_DIRECTORY = True
+ # Enable command batching across prepare() and assemble()
+ def configure_sandbox(self, sandbox):
+ super().configure_sandbox(sandbox)
+ self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
+ collect=self.get_variable('install-root'))
+
# Plugin entry point
def setup():
diff --git a/buildstream/plugins/elements/manual.py b/buildstream/plugins/elements/manual.py
index 8f951ab38..7ca761428 100644
--- a/buildstream/plugins/elements/manual.py
+++ b/buildstream/plugins/elements/manual.py
@@ -31,7 +31,7 @@ See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
details on common configuration options for build elements.
"""
-from buildstream import BuildElement
+from buildstream import BuildElement, SandboxFlags
# Element implementation for the 'manual' kind.
@@ -39,6 +39,12 @@ class ManualElement(BuildElement):
# Supports virtual directories (required for remote execution)
BST_VIRTUAL_DIRECTORY = True
+ # Enable command batching across prepare() and assemble()
+ def configure_sandbox(self, sandbox):
+ super().configure_sandbox(sandbox)
+ self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
+ collect=self.get_variable('install-root'))
+
# Plugin entry point
def setup():
diff --git a/buildstream/plugins/elements/meson.py b/buildstream/plugins/elements/meson.py
index 0d5ca0087..b16f025a0 100644
--- a/buildstream/plugins/elements/meson.py
+++ b/buildstream/plugins/elements/meson.py
@@ -51,7 +51,7 @@ See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
details on common configuration options for build elements.
"""
-from buildstream import BuildElement
+from buildstream import BuildElement, SandboxFlags
# Element implementation for the 'meson' kind.
@@ -59,6 +59,12 @@ class MesonElement(BuildElement):
# Supports virtual directories (required for remote execution)
BST_VIRTUAL_DIRECTORY = True
+ # Enable command batching across prepare() and assemble()
+ def configure_sandbox(self, sandbox):
+ super().configure_sandbox(sandbox)
+ self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
+ collect=self.get_variable('install-root'))
+
# Plugin entry point
def setup():
diff --git a/buildstream/plugins/elements/modulebuild.py b/buildstream/plugins/elements/modulebuild.py
index c17dd00f2..a83d2705d 100644
--- a/buildstream/plugins/elements/modulebuild.py
+++ b/buildstream/plugins/elements/modulebuild.py
@@ -31,7 +31,7 @@ See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
details on common configuration options for build elements.
"""
-from buildstream import BuildElement
+from buildstream import BuildElement, SandboxFlags
# Element implementation for the 'modulebuild' kind.
@@ -39,6 +39,12 @@ class ModuleBuildElement(BuildElement):
# Supports virtual directories (required for remote execution)
BST_VIRTUAL_DIRECTORY = True
+ # Enable command batching across prepare() and assemble()
+ def configure_sandbox(self, sandbox):
+ super().configure_sandbox(sandbox)
+ self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
+ collect=self.get_variable('install-root'))
+
# Plugin entry point
def setup():
diff --git a/buildstream/plugins/elements/pip.py b/buildstream/plugins/elements/pip.py
index 20e2b5bb0..31e1071f0 100644
--- a/buildstream/plugins/elements/pip.py
+++ b/buildstream/plugins/elements/pip.py
@@ -31,7 +31,7 @@ See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
details on common configuration options for build elements.
"""
-from buildstream import BuildElement
+from buildstream import BuildElement, SandboxFlags
# Element implementation for the 'pip' kind.
@@ -39,6 +39,12 @@ class PipElement(BuildElement):
# Supports virtual directories (required for remote execution)
BST_VIRTUAL_DIRECTORY = True
+ # Enable command batching across prepare() and assemble()
+ def configure_sandbox(self, sandbox):
+ super().configure_sandbox(sandbox)
+ self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
+ collect=self.get_variable('install-root'))
+
# Plugin entry point
def setup():
diff --git a/buildstream/plugins/elements/qmake.py b/buildstream/plugins/elements/qmake.py
index d6776b0b2..1bb5fd74a 100644
--- a/buildstream/plugins/elements/qmake.py
+++ b/buildstream/plugins/elements/qmake.py
@@ -31,7 +31,7 @@ See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
details on common configuration options for build elements.
"""
-from buildstream import BuildElement
+from buildstream import BuildElement, SandboxFlags
# Element implementation for the 'qmake' kind.
@@ -39,6 +39,12 @@ class QMakeElement(BuildElement):
# Supports virtual directories (required for remote execution)
BST_VIRTUAL_DIRECTORY = True
+ # Enable command batching across prepare() and assemble()
+ def configure_sandbox(self, sandbox):
+ super().configure_sandbox(sandbox)
+ self.batch_prepare_assemble(SandboxFlags.ROOT_READ_ONLY,
+ collect=self.get_variable('install-root'))
+
# Plugin entry point
def setup():