When building an artifact with no build-tree generated, an exception is thrown
Summary
When trying to build an artifact fails and no buildtree is generated (e.g. missing a shell in the element), an exception is thrown when trying to push the build-tree.
Steps to reproduce
- Configure a remote artifact cache
- Create an element with no build dependencies
- try building it
What is the current bug behavior?
An assertion is thrown
What is the expected correct behavior?
Nothing, an error happened and no build tree was generated, this is expected.
Relevant logs and/or screenshots
An unhandled exception occured:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/buildstream/_scheduler/jobs/job.py", line 775, in child_action
result = self.child_process() # pylint: disable=assignment-from-no-return
File "/usr/local/lib/python3.7/dist-packages/buildstream/_scheduler/jobs/elementjob.py", line 105, in child_process
return self._action_cb(self._element)
File "/usr/local/lib/python3.7/dist-packages/buildstream/_scheduler/queues/artifactpushqueue.py", line 46, in _push_or_skip
if not element._push():
File "/usr/local/lib/python3.7/dist-packages/buildstream/element.py", line 1937, in _push
pushed = self.__artifacts.push(self, self.__artifact)
File "/usr/local/lib/python3.7/dist-packages/buildstream/_artifactcache.py", line 260, in push
if self._push_artifact_blobs(artifact, remote):
File "/usr/local/lib/python3.7/dist-packages/buildstream/_artifactcache.py", line 563, in _push_artifact_blobs
self.cas._send_directory(remote, artifact_proto.files)
File "/usr/local/lib/python3.7/dist-packages/buildstream/_cas/cascache.py", line 908, in _send_directory
missing_blobs = self.remote_missing_blobs_for_directory(remote, digest)
File "/usr/local/lib/python3.7/dist-packages/buildstream/_cas/cascache.py", line 508, in remote_missing_blobs_for_directory
return self.remote_missing_blobs(remote, required_blobs)
File "/usr/local/lib/python3.7/dist-packages/buildstream/_cas/cascache.py", line 528, in remote_missing_blobs
for required_digest in required_blobs_group:
File "/usr/local/lib/python3.7/dist-packages/buildstream/_cas/cascache.py", line 578, in required_blobs_for_directory
with open(self.objpath(directory_digest), 'rb') as f:
IsADirectoryError: [Errno 21] Is a directory: '/home/buildstream/.cache/buildstream/cas/objects/'