summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-02-27 18:39:45 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-02-28 00:07:04 +0900
commit9e3a26aadb844a98f3b91b494e333f6984bed5b5 (patch)
tree0b859876acd9833b5ce458a87a51dc52e3f0328a
parent63eb06bc762b98b34d06b22aac32bf54c78cac26 (diff)
downloadbuildstream-9e3a26aadb844a98f3b91b494e333f6984bed5b5.tar.gz
element.py: Inform the sandbox of host-files when running a shell
Does not apply to isolated shells.
-rw-r--r--buildstream/element.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 29c4f8b89..2bd7abfca 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1430,6 +1430,16 @@ class Element(Plugin):
if os.environ.get(inherit) is not None:
environment[inherit] = os.environ.get(inherit)
+ # Setup any project defined bind mounts
+ for target, source in _yaml.node_items(project._shell_host_files):
+ if not os.path.exists(source):
+ self.warn("Not mounting non-existing host file: {}".format(source))
+ elif os.path.isdir(source):
+ self.warn("Not mounting directory listed as host file: {}".format(source))
+ else:
+ sandbox.mark_directory(target)
+ sandbox._set_mount_source(target, source)
+
if command:
argv = [arg for arg in command]
else: