Stack trace when log files cause UTF-8 errors
When trying to view the logs of a failed build I encountered a stack trace due to a non-utf-8 character appearing in the build log.
Steps to reproduce
Attempt to build ntfs-3g on top of freedesktop-sdk's bootstrap-import using a default autotools element, the build should fail in the install-commands and trying to view the logs will give a stack trace.
What is the current bug behavior?
Attempting to view log gives
Build failure on element: vm/deploy-tools/ntfs3g.bst Choose one of the following options: (c)ontinue - Continue queueing jobs as much as possible (q)uit - Exit after all ongoing jobs complete (t)erminate - Terminate any ongoing jobs and exit (r)etry - Retry this job (l)og - View the full log file (s)hell - Drop into a shell in the failed build sandbox Pressing ^C will terminate jobs and exit Choice: [continue]: l Unknown exception in SIGCHLD handler Traceback (most recent call last): File "/usr/lib/python3.5/asyncio/unix_events.py", line 808, in _sig_chld self._do_waitpid_all() File "/usr/lib/python3.5/asyncio/unix_events.py", line 874, in _do_waitpid_all self._do_waitpid(pid) File "/usr/lib/python3.5/asyncio/unix_events.py", line 908, in _do_waitpid callback(pid, returncode, *args) File "/home/thomascoldrick/buildstream/buildstream/_scheduler/jobs/job.py", line 553, in _parent_child_completed self._scheduler.job_completed(self, returncode == RC_OK) File "/home/thomascoldrick/buildstream/buildstream/_scheduler/scheduler.py", line 238, in job_completed self._job_complete_callback(job, success) File "/home/thomascoldrick/buildstream/buildstream/_frontend/app.py", line 545, in _job_completed self._handle_failure(element, queue, failure) File "/home/thomascoldrick/buildstream/buildstream/_frontend/app.py", line 611, in _handle_failure content = logfile.read() File "/usr/lib/python3.5/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 47855: invalid start byte
And doesn't exit to terminal, hanging after the stack trace.
- BuildStream version affected: 1.2.0