diff options
author | Jürg Billeter <j@bitron.ch> | 2019-03-02 09:44:59 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-03-06 10:31:06 +0100 |
commit | 55f348797602506f3b3ec3a7bfa47af989249161 (patch) | |
tree | c393c5ffdbebcfbcc3ac9ad6c853ff31f2f63e70 /buildstream | |
parent | ee66be4017600a95e3c055ff848fb10f1554eef8 (diff) | |
download | buildstream-55f348797602506f3b3ec3a7bfa47af989249161.tar.gz |
element.py: Disable Sandbox.run() for elements that don't need it
This will allow faster staging.
Diffstat (limited to 'buildstream')
-rw-r--r-- | buildstream/element.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 54e30cbbf..47ca04c28 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -1630,6 +1630,13 @@ class Element(Plugin): with _signals.terminator(cleanup_rootdir), \ self.__sandbox(rootdir, output_file, output_file, self.__sandbox_config) as sandbox: # noqa + if not self.BST_RUN_COMMANDS: + # Element doesn't need to run any commands in the sandbox. + # + # Disable Sandbox.run() to allow CasBasedDirectory for all + # sandboxes. + sandbox._disable_run() + # By default, the dynamic public data is the same as the static public data. # The plugin's assemble() method may modify this, though. self.__dynamic_public = _yaml.node_copy(self.__public) |