Improve the fatal error message of the yocto-kernel-tools symbol_why.py
and shows the command that generate the error as it can help understand
the root cause of the error.

Signed-off-by: Jose Quaresma <[email protected]>
---
 meta/classes-recipe/kernel-yocto.bbclass | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/meta/classes-recipe/kernel-yocto.bbclass 
b/meta/classes-recipe/kernel-yocto.bbclass
index 8eda0dcaf3..46df9b23dc 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -573,9 +573,10 @@ python do_kernel_configcheck() {
 
     # category #1: mismatches
     try:
-        analysis = subprocess.check_output(['symbol_why.py', '--dotconfig',  
'{}'.format( d.getVar('B') + '/.config' ), '--mismatches', extra_params], 
cwd=s, env=env ).decode('utf-8')
+        cmd = ['symbol_why.py', '--dotconfig',  '{}'.format( d.getVar('B') + 
'/.config' ), '--mismatches', extra_params]
+        analysis = subprocess.check_output(cmd, cwd=s, env=env 
).decode('utf-8')
     except subprocess.CalledProcessError as e:
-        bb.fatal( "config analysis failed: %s" % e.output.decode('utf-8'))
+        bb.fatal( "config analysis failed when running '%s': %s" % (" 
".join(cmd), e.output.decode('utf-8')))
 
     if analysis:
         outfile = "{}/{}/cfg/mismatch.txt".format( s, kmeta )
@@ -595,9 +596,10 @@ python do_kernel_configcheck() {
     if bsp_check_visibility > 1:
         extra_params = "--strict"
     try:
-        analysis = subprocess.check_output(['symbol_why.py', '--dotconfig',  
'{}'.format( d.getVar('B') + '/.config' ), '--invalid', extra_params], cwd=s, 
env=env ).decode('utf-8')
+        cmd = ['symbol_why.py', '--dotconfig',  '{}'.format( d.getVar('B') + 
'/.config' ), '--invalid', extra_params]
+        analysis = subprocess.check_output(cmd, cwd=s, env=env 
).decode('utf-8')
     except subprocess.CalledProcessError as e:
-        bb.fatal( "config analysis failed: %s" % e.output.decode('utf-8'))
+        bb.fatal( "config analysis failed when running '%s': %s" % (" 
".join(cmd), e.output.decode('utf-8')))
 
     if analysis:
         outfile = "{}/{}/cfg/invalid.txt".format(s,kmeta)
@@ -614,9 +616,10 @@ python do_kernel_configcheck() {
 
     # category #3: redefined options (this is pretty verbose and is debug only)
     try:
-        analysis = subprocess.check_output(['symbol_why.py', '--dotconfig',  
'{}'.format( d.getVar('B') + '/.config' ), '--sanity'], cwd=s, env=env 
).decode('utf-8')
+        cmd = ['symbol_why.py', '--dotconfig',  '{}'.format( d.getVar('B') + 
'/.config' ), '--sanity']
+        analysis = subprocess.check_output(cmd, cwd=s, env=env 
).decode('utf-8')
     except subprocess.CalledProcessError as e:
-        bb.fatal( "config analysis failed: %s" % e.output.decode('utf-8'))
+        bb.fatal( "config analysis failed when running '%s': %s" % (" 
".join(cmd), e.output.decode('utf-8')))
 
     if analysis:
         outfile = "{}/{}/cfg/redefinition.txt".format(s,kmeta)
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#171235): 
https://lists.openembedded.org/g/openembedded-core/message/171235
Mute This Topic: https://lists.openembedded.org/mt/94022666/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to