]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: lib/bb/utils: show subprocess output in stack traces
authorRoss Burton <ross.burton@intel.com>
Mon, 18 Jul 2016 16:22:55 +0000 (17:22 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 29 Jul 2016 08:53:32 +0000 (09:53 +0100)
If better_exec() throws a subprocess.CalledProcessError then show the output to
the user as it likely contains useful information for solving the problem.

(Bitbake rev: 8a6424ed871c3cbacd21cae8bc801197f83d67a6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/utils.py

index 995089a384f9847c51145f6d523a8133d015b067..ce52960b430712d38fc230be174764a04e64d3a5 100644 (file)
@@ -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))