From bb7c3213ee42209d3dcb4f9ad369900a042b638a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Thu, 4 Oct 2018 11:48:13 +0200 Subject: element.py: Defer workspace.prepared setting in case of pending commands --- buildstream/element.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/buildstream/element.py b/buildstream/element.py index c249ed2f2..582492d6b 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -2075,7 +2075,12 @@ class Element(Plugin): self.prepare(sandbox) if workspace: - workspace.prepared = True + def mark_workspace_prepared(): + workspace.prepared = True + + # Defer workspace.prepared setting until pending batch commands + # have been executed. + sandbox._callback(mark_workspace_prepared) def __is_cached(self, keystrength): if keystrength is None: -- cgit v1.2.1