From: Ross Burton Date: Mon, 18 Jul 2016 16:22:55 +0000 (+0100) Subject: bitbake: lib/bb/utils: show subprocess output in stack traces X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea234239f41a94a4b13b68648d8dc611f793a441;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bitbake: 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. (Bitbake rev: 8a6424ed871c3cbacd21cae8bc801197f83d67a6) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 995089a384f..ce52960b430 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/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))