[oe-commits] [openembedded-core] 08/08: devicetree.bbclass: Combine stderr into stdout to see actual dtc error

git at git.openembedded.org git at git.openembedded.org
Fri Jun 14 10:56:41 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit afc37f0f032b30480caa9b24de28b90e3700931f
Author: Jaewon Lee <jaewon.lee at xilinx.com>
AuthorDate: Wed Jun 12 16:29:01 2019 -0700

    devicetree.bbclass: Combine stderr into stdout to see actual dtc error
    
    Previously the subprocess command to run dtc was not properly displaying
    the error on console. Combining stderr into stdout for the dtc subprocess
    so the actual error can be seen on console without having to open the
    do_compile log.
    
    For example, previously on a dtc error, just the following stack trace
    and dtc command was being shown on console:
    
    File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
         0001:
     *** 0002:devicetree_do_compile(d)
         0003:
    File:
    function: devicetree_do_compile
         0127:            if not(os.path.isfile(dtspath)) or
    not(dts.endswith(".dts") or devicetree_source_is_overlay(dtspath)):
         0128:                continue # skip non-.dts files and non-overlay
    files
         0129:        except:
         0130:            continue # skip if can't determine if overlay
     *** 0131:        devicetree_compile(dtspath, includes, d)
    
        ...
    
    Exception: subprocess.CalledProcessError: Command '['dtc', '-R', '8',
    '-b', '0', '-p', '0x1000', '-i', '${INCLUDES}, '-o', 'system-top.dtb',
    '-I', 'dts', '-O', 'dtb', 'system-top.dts.pp']' returned non-zero exit
    status 1
    
    with this patch, the actual error from the dtc command will be appended
    like the following:
    
    Subprocess output:
    Error: Label or path not found
    FATAL ERROR: Syntax error parsing input tree
    
    Signed-off-by: Jaewon Lee <jaewon.lee at xilinx.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/devicetree.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/devicetree.bbclass b/meta/classes/devicetree.bbclass
index 5c03e4b..d8779c7 100644
--- a/meta/classes/devicetree.bbclass
+++ b/meta/classes/devicetree.bbclass
@@ -116,7 +116,7 @@ def devicetree_compile(dtspath, includes, d):
     dtcargs += ["-o", "{0}.{1}".format(dtname, "dtbo" if isoverlay else "dtb")]
     dtcargs += ["-I", "dts", "-O", "dtb", "{0}.pp".format(dts)]
     bb.note("Running {0}".format(" ".join(dtcargs)))
-    subprocess.run(dtcargs, check = True)
+    subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 
 python devicetree_do_compile() {
     includes = expand_includes("DT_INCLUDE", d)

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


More information about the Openembedded-commits mailing list