summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarius Makovsky <traveltissues@protonmail.com>2020-01-13 09:06:11 +0000
committerJürg Billeter <j@bitron.ch>2020-02-11 21:08:59 +0100
commit1ee61a88bf0e3cbb0395153c681124990004e4ca (patch)
treeda47586dae6f3bb7bb16a239d25bd5c81ce95fb4
parent04c00da690bce67bd937a71dce5d84a338a0521f (diff)
downloadbuildstream-1ee61a88bf0e3cbb0395153c681124990004e4ca.tar.gz
_workspaces: Rename `last_successful` to `last_build`
The new incremental build approach uses the buildtree from the last build (successful or not) and no longer needs to know any information about the last successful build.
-rw-r--r--src/buildstream/_loader/loader.py2
-rw-r--r--src/buildstream/_stream.py2
-rw-r--r--src/buildstream/_workspaces.py14
-rw-r--r--src/buildstream/element.py4
-rw-r--r--src/buildstream/plugins/sources/workspace.py8
5 files changed, 15 insertions, 15 deletions
diff --git a/src/buildstream/_loader/loader.py b/src/buildstream/_loader/loader.py
index 3200920b9..35de1b97d 100644
--- a/src/buildstream/_loader/loader.py
+++ b/src/buildstream/_loader/loader.py
@@ -456,7 +456,7 @@ class Loader:
if workspace:
workspace_node = {"kind": "workspace"}
workspace_node["path"] = workspace.get_absolute_path()
- workspace_node["last_successful"] = str(workspace.to_dict().get("last_successful", ""))
+ workspace_node["last_build"] = str(workspace.to_dict().get("last_build", ""))
node[Symbol.SOURCES] = [workspace_node]
skip_workspace = False
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 0687226ef..92b9f5113 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -930,7 +930,7 @@ class Stream:
workspace_path = workspace.get_absolute_path()
if soft:
- workspace.last_successful = None
+ workspace.last_build = None
self._message(
MessageType.INFO, "Reset workspace state for {} at: {}".format(element.name, workspace_path)
)
diff --git a/src/buildstream/_workspaces.py b/src/buildstream/_workspaces.py
index 1057e8521..a54a17ff1 100644
--- a/src/buildstream/_workspaces.py
+++ b/src/buildstream/_workspaces.py
@@ -232,18 +232,18 @@ class WorkspaceProjectCache:
# An object to contain various helper functions and data required for
# workspaces.
#
-# last_successful and path are intended to be public
+# last_build and path are intended to be public
# properties, but may be best accessed using this classes' helper
# methods.
#
# Args:
# toplevel_project (Project): Top project. Will be used for resolving relative workspace paths.
# path (str): The path that should host this workspace
-# last_successful (str): The key of the last successful build of this workspace
+# last_build (str): The key of the last attempted build of this workspace
#
class Workspace:
- def __init__(self, toplevel_project, *, last_successful=None, path=None):
- self.last_successful = last_successful
+ def __init__(self, toplevel_project, *, last_build=None, path=None):
+ self.last_build = last_build
self._path = path
self._toplevel_project = toplevel_project
@@ -258,8 +258,8 @@ class Workspace:
#
def to_dict(self):
ret = {"path": self._path}
- if self.last_successful is not None:
- ret["last_successful"] = self.last_successful
+ if self.last_build is not None:
+ ret["last_build"] = self.last_build
return ret
# from_dict():
@@ -516,7 +516,7 @@ class Workspaces:
def _load_workspace(self, node):
dictionary = {
"path": node.get_str("path"),
- "last_successful": node.get_str("last_successful", default=None),
+ "last_build": node.get_str("last_build", default=None),
}
return Workspace.from_dict(self._toplevel_project, dictionary)
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index d6a3b7cf4..4d91976f9 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -1527,7 +1527,7 @@ class Element(Plugin):
self.__update_cache_key_non_strict()
self._update_ready_for_runtime_and_cached()
- if self._get_workspace() and self._cached_success():
+ if self._get_workspace() and self._cached():
assert utils._is_main_process(), "Attempted to save workspace configuration from child process"
#
# Note that this block can only happen in the
@@ -1539,7 +1539,7 @@ class Element(Plugin):
#
key = self._get_cache_key()
workspace = self._get_workspace()
- workspace.last_successful = key
+ workspace.last_build = key
self._get_context().get_workspaces().save_config()
# _assemble():
diff --git a/src/buildstream/plugins/sources/workspace.py b/src/buildstream/plugins/sources/workspace.py
index f1ad2eead..13e2bb37d 100644
--- a/src/buildstream/plugins/sources/workspace.py
+++ b/src/buildstream/plugins/sources/workspace.py
@@ -55,16 +55,16 @@ class WorkspaceSource(Source):
self.__unique_key = None
# the digest of the Directory following the import of the workspace
self.__digest = None
- # the cache key of the last successful workspace
- self.__last_successful = None
+ # the cache key of the last workspace build
+ self.__last_build = None
def track(self) -> SourceRef: # pylint: disable=arguments-differ
return None
def configure(self, node: MappingNode) -> None:
- node.validate_keys(["path", "last_successful", "kind"])
+ node.validate_keys(["path", "last_build", "kind"])
self.path = node.get_str("path")
- self.__last_successful = node.get_str("last_successful")
+ self.__last_build = node.get_str("last_build")
def preflight(self) -> None:
pass # pragma: nocover