From 78f05bb7d6af99b6716cfee56d1bf382b9243b62 Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Fri, 4 Oct 2019 18:11:10 +0100 Subject: _artifactcache.py: Don't push artifact blobs when no files are present Previously, if an artifact proto had no files at all in it, we would fail at pushing it, making BuildStream crash. When no files are part of an artifact proto, we can short-circuit the call and avoid pushing them unecessarily. - Add a test to ensure this doesn't come back. --- src/buildstream/_artifactcache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/buildstream/_artifactcache.py') diff --git a/src/buildstream/_artifactcache.py b/src/buildstream/_artifactcache.py index f8d856be7..b4d4efe00 100644 --- a/src/buildstream/_artifactcache.py +++ b/src/buildstream/_artifactcache.py @@ -560,7 +560,8 @@ class ArtifactCache(BaseCache): artifact_proto = artifact._get_proto() try: - self.cas._send_directory(remote, artifact_proto.files) + if str(artifact_proto.files): + self.cas._send_directory(remote, artifact_proto.files) if str(artifact_proto.buildtree): try: -- cgit v1.2.1