diff options
author | bst-marge-bot <marge-bot@buildstream.build> | 2019-10-08 16:33:51 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-10-08 16:33:51 +0000 |
commit | 31b23110443365e1608fd45c3c7242ce4e8b1060 (patch) | |
tree | 55394906f333e61e286fc20e207bd20f19c927dc /src/buildstream/plugins/sources | |
parent | 97cd51d6d018c43d32ca433f0bcad7cf0dd77ca0 (diff) | |
parent | 3d9458605ca87a87c9170d80cee4fecac19a0a67 (diff) | |
download | buildstream-31b23110443365e1608fd45c3c7242ce4e8b1060.tar.gz |
Merge branch 'traveltissues/1159' into 'master'
Defer workspace source commits
Closes #1159
See merge request BuildStream/buildstream!1628
Diffstat (limited to 'src/buildstream/plugins/sources')
-rw-r--r-- | src/buildstream/plugins/sources/workspace.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/buildstream/plugins/sources/workspace.py b/src/buildstream/plugins/sources/workspace.py index ee145babb..0e7797fe8 100644 --- a/src/buildstream/plugins/sources/workspace.py +++ b/src/buildstream/plugins/sources/workspace.py @@ -89,10 +89,10 @@ class WorkspaceSource(Source): pass # pragma: nocover def get_unique_key(self) -> (str, SourceRef): - sourcecache = self._get_context().sourcecache + cas = self._get_context().get_cascache() if self.__cas_dir is None: - self.__cas_dir = CasBasedDirectory(sourcecache.cas) + self.__cas_dir = CasBasedDirectory(cas) if self.__digest is None: @@ -103,14 +103,9 @@ class WorkspaceSource(Source): "Failed to stage source: files clash with existing directory", 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() + cas.close_channel() + assert not cas.has_open_grpc_channels() return (self.path, self.__digest) def init_workspace(self, directory: Directory) -> None: |