summaryrefslogtreecommitdiff
path: root/buildstream/buildelement.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-02-03 03:22:27 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-02-03 03:22:27 +0900
commitd58eb21a2129a7a07d7e99f5b3f149b71021fa6c (patch)
tree48c9668514f80ff1072edc734ade29e62df8dbb0 /buildstream/buildelement.py
parent93726549bc1e6ded5cee60fc40a255b3d36c490d (diff)
downloadbuildstream-d58eb21a2129a7a07d7e99f5b3f149b71021fa6c.tar.gz
buildelement: Ensure build directory exists
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')