summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildstream/element.py7
1 files changed, 6 insertions, 1 deletions
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: