From 55697cc4cae5784baa32e95c574dca827a44aa95 Mon Sep 17 00:00:00 2001 From: Darius Makovsky Date: Fri, 27 Sep 2019 16:48:21 +0100 Subject: Commit workspace sources to sourcecache after generating their keys --- src/buildstream/element.py | 3 +++ src/buildstream/plugins/sources/workspace.py | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/buildstream/element.py b/src/buildstream/element.py index ef610bcc1..73151043d 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -2225,6 +2225,9 @@ class Element(Plugin): # Check all sources are in source cache for source in self.__sources: + # XXX workspaces are not necessarily cached + if source.get_kind() == 'workspace': + sourcecache.commit(source, []) if not sourcecache.contains(source): return False diff --git a/src/buildstream/plugins/sources/workspace.py b/src/buildstream/plugins/sources/workspace.py index f303ce656..cacc02cd3 100644 --- a/src/buildstream/plugins/sources/workspace.py +++ b/src/buildstream/plugins/sources/workspace.py @@ -104,10 +104,6 @@ class WorkspaceSource(Source): reason='ensure-stage-dir-fail') self.__digest = self.__cas_dir._get_digest().hash - # commit to cache if not cached - if not sourcecache.contains(self): - sourcecache.commit(self, []) - # now close down grpc channels sourcecache.cas.close_channel() assert not sourcecache.cas.has_open_grpc_channels() -- cgit v1.2.1