diff options
| author | Ross Burton <ross.burton@intel.com> | 2016-07-18 17:22:55 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-29 09:53:32 +0100 |
| commit | ea234239f41a94a4b13b68648d8dc611f793a441 (patch) | |
| tree | eef70153531fe300768cdb64a3dbf499e2ce3d7e | |
| parent | c42b5333f0261daa749306471c294c13dc33968a (diff) | |
| download | poky-ea234239f41a94a4b13b68648d8dc611f793a441.tar.gz | |
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 <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/bb/utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 995089a384..ce52960b43 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): | |||
| 375 | level = level + 1 | 375 | level = level + 1 |
| 376 | 376 | ||
| 377 | error.append("Exception: %s" % ''.join(exception)) | 377 | error.append("Exception: %s" % ''.join(exception)) |
| 378 | |||
| 379 | # If the exception is from spwaning a task, let's be helpful and display | ||
| 380 | # the output (which hopefully includes stderr). | ||
| 381 | if isinstance(value, subprocess.CalledProcessError): | ||
| 382 | error.append("Subprocess output:") | ||
| 383 | error.append(value.output.decode("utf-8", errors="ignore")) | ||
| 378 | finally: | 384 | finally: |
| 379 | logger.error("\n".join(error)) | 385 | logger.error("\n".join(error)) |
| 380 | 386 | ||
