[oe-commits] [bitbake] 02/05: lib/bb/utils: show subprocess output in stack traces

git at git.openembedded.org git at git.openembedded.org
Fri Jul 29 08:55:28 UTC 2016


rpurdie pushed a commit to branch master
in repository bitbake.

commit 8a6424ed871c3cbacd21cae8bc801197f83d67a6
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Mon Jul 18 17:22:55 2016 +0100

    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 at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/utils.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 995089a..ce52960 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))
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list