summaryrefslogtreecommitdiff
path: root/src/buildstream/_artifactcache.py
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-10-04 18:11:10 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-10-08 18:13:11 +0000
commit78f05bb7d6af99b6716cfee56d1bf382b9243b62 (patch)
tree1ea1b26462e007a870e8df3f179aca1842f44e14 /src/buildstream/_artifactcache.py
parentd390fd62f28db1cb812554d386f2b3560e5e6628 (diff)
downloadbuildstream-78f05bb7d6af99b6716cfee56d1bf382b9243b62.tar.gz
_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.
Diffstat (limited to 'src/buildstream/_artifactcache.py')
-rw-r--r--src/buildstream/_artifactcache.py3
1 files changed, 2 insertions, 1 deletions
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: