summaryrefslogtreecommitdiff
path: root/buildstream/buildelement.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/buildelement.py')
-rw-r--r--buildstream/buildelement.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/buildstream/buildelement.py b/buildstream/buildelement.py
index 580f8dea3..b5f5e592d 100644
--- a/buildstream/buildelement.py
+++ b/buildstream/buildelement.py
@@ -22,6 +22,7 @@
implementing the most common case of element.
"""
+import os
from . import Element, Scope, ElementError
@@ -70,6 +71,12 @@ class BuildElement(Element):
# Stage sources in /buildstream/build
self.stage_sources(sandbox, '/buildstream/build')
+ # Create the build dir incase there is no sources staged
+ os.makedirs(os.path.join(
+ sandbox.executor.fs_root,
+ 'buildstream',
+ 'build'), exist_ok=True)
+
# And set the sandbox work directory too
sandbox.set_cwd('/buildstream/build')