summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Smith <qinusty@gmail.com>2018-09-19 17:53:08 +0100
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-10-04 13:43:10 +0000
commitc5778941217fb0ebbaed6eb6d6a0b255918e01a4 (patch)
tree0db4cc28d79ca9e024e0f6a0f54d6654ae1f6580
parentfd6a957366e5abe3cddc225118969205000e182d (diff)
downloadbuildstream-c5778941217fb0ebbaed6eb6d6a0b255918e01a4.tar.gz
element.py: Do not save workspace on failed build
This fixes #634, BuildStream no longer saves workspace configuration on a failed build.
-rw-r--r--buildstream/element.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 9154f10e8..25ef22ed2 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -212,7 +212,7 @@ class Element(Plugin):
self.__staged_sources_directory = None # Location where Element.stage_sources() was called
self.__tainted = None # Whether the artifact is tainted and should not be shared
self.__required = False # Whether the artifact is required in the current session
- self.__build_result = None # The result of assembling this Element
+ self.__build_result = None # The result of assembling this Element (success, description, detail)
self._build_log_path = None # The path of the build log for this Element
# hash tables of loaded artifact metadata, hashed by key
@@ -1479,11 +1479,13 @@ class Element(Plugin):
self._update_state()
- if self._get_workspace() and self._cached():
+ if self._get_workspace() and self._cached_success():
+ assert utils._is_main_process(), \
+ "Attempted to save workspace configuration from child process"
#
# Note that this block can only happen in the
- # main process, since `self._cached()` cannot
- # be true when assembly is completed in the task.
+ # main process, since `self._cached_success()` cannot
+ # be true when assembly is successful in the task.
#
# For this reason, it is safe to update and
# save the workspaces configuration