File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -828,6 +828,21 @@ def run_cleanup_commands(self, sandbox: "Sandbox") -> None:
828828
829829 sandbox ._clean_directory (build_root )
830830
831+ @contextmanager
832+ def subsandbox (self , sandbox : "Sandbox" ) -> Iterator ["Sandbox" ]:
833+ """A context manager for a subsandbox.
834+
835+ Args:
836+ sandbox: The main build sandbox
837+
838+ This allows an element to use a secondary sandbox for manipulating
839+ artifacts without affecting the main build sandbox. The subsandbox
840+ is initially empty.
841+ """
842+ subsandbox = sandbox ._create_subsandbox ()
843+ with self .__collect_overlaps (subsandbox ):
844+ yield subsandbox
845+
831846 #############################################################
832847 # Private Methods used in BuildStream #
833848 #############################################################
You can’t perform that action at this time.
0 commit comments