summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarius Makovsky <traveltissues@protonmail.com>2019-11-19 14:30:12 +0000
committerDarius Makovsky <traveltissues@protonmail.com>2019-11-27 09:42:02 +0000
commit267ea27e5f0294ff4c17e27001228216fdcd92d6 (patch)
tree0052cb0948022f2f000d89e2a2d3e0cf38e0d86d
parent7a3866a3e22d0d8eef9141c42c270c07242dd9c1 (diff)
downloadbuildstream-267ea27e5f0294ff4c17e27001228216fdcd92d6.tar.gz
Do not load the workspace.last_successful as the workspace plugin ref
Set the workspace plugin `__last_successful` attribute. loader: Use empty string as default when last_successful is missing
-rw-r--r--src/buildstream/_loader/loader.py2
-rw-r--r--src/buildstream/plugins/sources/workspace.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/buildstream/_loader/loader.py b/src/buildstream/_loader/loader.py
index b2e58b9e7..3b18af691 100644
--- a/src/buildstream/_loader/loader.py
+++ b/src/buildstream/_loader/loader.py
@@ -452,7 +452,7 @@ class Loader:
if workspace:
workspace_node = {"kind": "workspace"}
workspace_node["path"] = workspace.get_absolute_path()
- workspace_node["ref"] = str(workspace.to_dict().get("last_successful", "ignored"))
+ workspace_node["last_successful"] = str(workspace.to_dict().get("last_successful", ""))
node[Symbol.SOURCES] = [workspace_node]
skip_workspace = False
diff --git a/src/buildstream/plugins/sources/workspace.py b/src/buildstream/plugins/sources/workspace.py
index c7d16f685..3d4c93b5c 100644
--- a/src/buildstream/plugins/sources/workspace.py
+++ b/src/buildstream/plugins/sources/workspace.py
@@ -55,14 +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
def track(self) -> SourceRef: # pylint: disable=arguments-differ
return None
def configure(self, node: MappingNode) -> None:
- node.validate_keys(["path", "ref", "kind"])
+ node.validate_keys(["path", "last_successful", "kind"])
self.path = node.get_str("path")
- self.__digest = node.get_str("ref")
+ self.__last_successful = node.get_str("last_successful")
def preflight(self) -> None:
pass # pragma: nocover