You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 08:20:39 UTC
[buildstream] 09/33: WIP: pickle: _{artifact,
source}cache: __getstate__ no elements
This is an automated email from the ASF dual-hosted git repository.
tvb pushed a commit to branch aevri/picklable_jobs
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 5997c2a6c72c6b98c52fe8bf4460c7c0126a5049
Author: Angelos Evripiotis <je...@bloomberg.net>
AuthorDate: Tue Apr 2 11:50:36 2019 +0100
WIP: pickle: _{artifact,source}cache: __getstate__ no elements
---
src/buildstream/_artifactcache.py | 6 ++++++
src/buildstream/_sourcecache.py | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/src/buildstream/_artifactcache.py b/src/buildstream/_artifactcache.py
index 091b44d..7ba043f 100644
--- a/src/buildstream/_artifactcache.py
+++ b/src/buildstream/_artifactcache.py
@@ -70,6 +70,12 @@ class ArtifactCache(BaseCache):
self.cas.add_reachable_directories_callback(self._reachable_directories)
self.cas.add_reachable_digests_callback(self._reachable_digests)
+ def __getstate__(self):
+ state = self.__dict__.copy()
+ # TODO: actually pickle the elements, resolving to the same objects.
+ state['_required_elements'] = set()
+ return state
+
# mark_required_elements():
#
# Mark elements whose artifacts are required for the current run.
diff --git a/src/buildstream/_sourcecache.py b/src/buildstream/_sourcecache.py
index 1d3342a..e067f04 100644
--- a/src/buildstream/_sourcecache.py
+++ b/src/buildstream/_sourcecache.py
@@ -58,6 +58,12 @@ class SourceCache(BaseCache):
self.casquota.add_remove_callbacks(self.unrequired_sources, self.cas.remove)
self.casquota.add_list_refs_callback(self.list_sources)
+ def __getstate__(self):
+ state = self.__dict__.copy()
+ # TODO: actually pickle the sources, resolving to the same objects.
+ state['_required_sources'] = set()
+ return state
+
# mark_required_sources()
#
# Mark sources that are required by the current run.