summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim MacArthur <jim.macarthur@codethink.co.uk>2018-06-21 17:19:32 +0100
committerJim MacArthur <jim.macarthur@codethink.co.uk>2018-06-26 09:34:16 +0100
commita6ab21a8c36e9fc1d80eb3b46107b5d4fe09bbc4 (patch)
treed7f17078ff95038e1bb80f41b2c4784ea4020027
parent5e2a75415950160ac0d6907dc3d92a1fd2bb7050 (diff)
downloadbuildstream-a6ab21a8c36e9fc1d80eb3b46107b5d4fe09bbc4.tar.gz
cascache.py: Correction to _required_blobs; objects should upload again now.
-rw-r--r--buildstream/_artifactcache/cascache.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py
index 572b6956d..3c32306a9 100644
--- a/buildstream/_artifactcache/cascache.py
+++ b/buildstream/_artifactcache/cascache.py
@@ -32,6 +32,7 @@ import grpc
from google.bytestream import bytestream_pb2, bytestream_pb2_grpc
from google.devtools.remoteexecution.v1test import remote_execution_pb2, remote_execution_pb2_grpc
from buildstream import buildstream_pb2, buildstream_pb2_grpc
+from google.protobuf.message import DecodeError
from .. import _signals, utils
from .._exceptions import ArtifactError
@@ -609,9 +610,6 @@ class CASCache(ArtifactCache):
q.put(str(e))
def _required_blobs(self, tree):
- if not isinstance(tree, remote_execution_pb2.Directory):
- # If it's not a tree, it has no dependencies
- return
# parse directory, and recursively add blobs
d = remote_execution_pb2.Digest()
d.hash = tree.hash
@@ -621,7 +619,11 @@ class CASCache(ArtifactCache):
directory = remote_execution_pb2.Directory()
with open(self.objpath(tree), 'rb') as f:
- directory.ParseFromString(f.read())
+ try:
+ directory.ParseFromString(f.read())
+ except DecodeError as d:
+ # OK, that probably wasn't a directory. In which case, it has no dependencies.
+ return
for filenode in directory.files:
d = remote_execution_pb2.Digest()