aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/utils.py
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-07-18 17:22:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-29 09:53:15 +0100
commit8a6424ed871c3cbacd21cae8bc801197f83d67a6 (patch)
tree457e89a036b04b8568093e57ebbc094dd7bc0b7a /lib/bb/utils.py
parentcc67800f279fb211ee3bb4ea7009fdbb82973b02 (diff)
downloadbitbake-8a6424ed871c3cbacd21cae8bc801197f83d67a6.tar.gz
lib/bb/utils: show subprocess output in stack traces
If better_exec() throws a subprocess.CalledProcessError then show the output to the user as it likely contains useful information for solving the problem. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/utils.py')
-rw-r--r--lib/bb/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 995089a38..ce52960b4 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -375,6 +375,12 @@ def _print_exception(t, value, tb, realfile, text, context):
level = level + 1
error.append("Exception: %s" % ''.join(exception))
+
+ # If the exception is from spwaning a task, let's be helpful and display
+ # the output (which hopefully includes stderr).
+ if isinstance(value, subprocess.CalledProcessError):
+ error.append("Subprocess output:")
+ error.append(value.output.decode("utf-8", errors="ignore"))
finally:
logger.error("\n".join(error))