summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarius Makovsky <traveltissues@protonmail.com>2019-09-11 18:01:05 +0100
committerDarius Makovsky <traveltissues@protonmail.com>2019-09-12 16:51:55 +0100
commit67f988bea31307c26dd3b415fdf48d2dff74804d (patch)
tree7af93d62f54699a6eb46d0d94b28c57d993809ac
parent3662f25f1e4cee93c04ddaaf792e1b74b785a728 (diff)
downloadbuildstream-67f988bea31307c26dd3b415fdf48d2dff74804d.tar.gz
wip remove workspace handling
-rw-r--r--src/buildstream/element.py71
1 files changed, 4 insertions, 67 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index d2e7bd691..54fc98b3b 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -255,7 +255,6 @@ class Element(Plugin):
self.__sources = [] # type: List[Source]
self.__weak_cache_key = None # Our cached weak cache key
self.__strict_cache_key = None # Our cached cache key for strict builds
- self.__cache_keys_unstable = None # Whether the current cache keys can be considered as stable
self.__artifacts = context.artifactcache # Artifact cache
self.__sourcecache = context.sourcecache # Source cache
self.__consistency = Consistency.INCONSISTENT # Cached overall consistency state
@@ -1276,17 +1275,6 @@ class Element(Plugin):
self.__update_cache_keys()
self.__update_artifact_state()
- # Workspaces are initially marked with unstable cache keys. Keys will be
- # marked stable either when we verify that the workspace is already
- # cached, or when we build/pull the workspaced element.
- if self.__cache_keys_unstable:
- if not self._cached():
- self.__reset_cache_data()
- if not self.__assemble_scheduled:
- self._schedule_assemble()
-
- self.__update_cache_keys_stability()
-
# Workspaced sources are considered unstable if a build is pending
# as the build will modify the contents of the workspace.
# Determine as early as possible if a build is pending to discard
@@ -1589,11 +1577,6 @@ class Element(Plugin):
self._set_required()
- # Invalidate workspace key as the build modifies the workspace directory
- workspace = self._get_workspace()
- if workspace:
- workspace.invalidate_key()
-
self._update_state()
# _assemble_done():
@@ -1619,23 +1602,6 @@ class Element(Plugin):
self._update_state()
self._update_ready_for_runtime_and_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_success()` cannot
- # be true when assembly is successful in the task.
- #
- # For this reason, it is safe to update and
- # save the workspaces configuration
- #
- key = self._get_cache_key()
- workspace = self._get_workspace()
- workspace.last_successful = key
- workspace.clear_running_files()
- self._get_context().get_workspaces().save_config()
-
# _assemble():
#
# Internal method for running the entire build phase.
@@ -1804,10 +1770,6 @@ class Element(Plugin):
# (bool): Whether a pull operation is pending
#
def _pull_pending(self):
- if self._get_workspace():
- # Workspace builds are never pushed to artifact servers
- return False
-
# Check whether the pull has been invoked with a specific subdir requested
# in user context, as to complete a partial artifact
pull_buildtrees = self._get_context().pull_buildtrees
@@ -1874,7 +1836,7 @@ class Element(Plugin):
return True
def _skip_source_push(self):
- if not self.__sources or self._get_workspace():
+ if not self.__sources:
return True
return not (self.__sourcecache.has_push_remotes(plugin=self) and
self._source_cached())
@@ -2197,7 +2159,6 @@ class Element(Plugin):
}
project = self._get_project()
- workspace = self._get_workspace()
self.__cache_key_dict = {
'core-artifact-version': BST_CORE_ARTIFACT_VERSION,
@@ -2335,7 +2296,7 @@ class Element(Plugin):
def _update_ready_for_runtime_and_cached(self):
if not self.__ready_for_runtime_and_cached:
if self.__runtime_deps_uncached == 0 and self._cached_success() and \
- self.__cache_key and not self.__cache_keys_unstable:
+ self.__cache_key:
self.__ready_for_runtime_and_cached = True
# Notify reverse dependencies
@@ -3113,14 +3074,6 @@ class Element(Plugin):
def __update_cache_keys(self):
context = self._get_context()
- # If the Element is workspaced, we should *initially*
- # consider its keys unstable
- if self.__cache_keys_unstable is None:
- if self._get_workspace():
- self.__cache_keys_unstable = True
- else:
- self.__cache_keys_unstable = False
-
if self.__weak_cache_key is None:
# Calculate weak cache key
#
@@ -3201,22 +3154,6 @@ class Element(Plugin):
if context.get_strict():
self.__artifact = self.__strict_artifact
- # __update_cache_keys_stability()
- #
- # Update the __cache_keys_unstable attribute.
- #
- # Workspaces are considered to be unstable on a new element instance.
- # Otherwise if the element is cached or the build is done, then keys
- # are considered to be stable. In other cases there is no change to
- # the attribute.
- #
- def __update_cache_keys_stability(self):
- if self.__cache_keys_unstable:
- if self._cached():
- self.__cache_keys_unstable = False
- elif not self.__assemble_scheduled and self.__assemble_done:
- self.__cache_keys_unstable = False
-
# __update_cache_key_non_strict()
#
# Calculates the strong cache key if it hasn't already been set.
@@ -3269,7 +3206,7 @@ class Element(Plugin):
def __update_strict_cache_key_of_rdeps(self):
if not self.__updated_strict_cache_keys_of_rdeps:
if self.__runtime_deps_without_strict_cache_key == 0 and \
- self.__strict_cache_key is not None and not self.__cache_keys_unstable:
+ self.__strict_cache_key is not None:
self.__updated_strict_cache_keys_of_rdeps = True
# Notify reverse dependencies
@@ -3305,7 +3242,7 @@ class Element(Plugin):
def __update_ready_for_runtime(self):
if not self.__ready_for_runtime:
if self.__runtime_deps_without_cache_key == 0 and \
- self.__cache_key is not None and not self.__cache_keys_unstable:
+ self.__cache_key is not None:
self.__ready_for_runtime = True
# Notify reverse dependencies