diff options
author | Jürg Billeter <j@bitron.ch> | 2019-04-03 16:52:07 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-04-12 11:17:33 +0200 |
commit | 902384aa43fd6ff3ab04503a7df935a7c561c495 (patch) | |
tree | e8ced7028193416543d4768a026c4997fe874908 | |
parent | d0880afceec608a1a25ba9a73bd624707bcc5d31 (diff) | |
download | buildstream-902384aa43fd6ff3ab04503a7df935a7c561c495.tar.gz |
element.py: Set sandbox build directory
Let the sandbox know whether the buildtree will be required. This allows
the remote execution sandbox to skip buildtree download when it's not
needed.
-rw-r--r-- | buildstream/element.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index b31af1770..bc8f25cf8 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -1685,6 +1685,15 @@ class Element(Plugin): with _signals.terminator(cleanup_rootdir), \ self.__sandbox(rootdir, output_file, output_file, self.__sandbox_config) as sandbox: # noqa + # Let the sandbox know whether the buildtree will be required. + # This allows the remote execution sandbox to skip buildtree + # download when it's not needed. + buildroot = self.get_variable('build-root') + cache_buildtrees = context.cache_buildtrees + if cache_buildtrees != 'never': + always_cache_buildtrees = cache_buildtrees == 'always' + sandbox._set_build_directory(buildroot, always=always_cache_buildtrees) + if not self.BST_RUN_COMMANDS: # Element doesn't need to run any commands in the sandbox. # |