diff mbox series

[v2] kernel-yocto: improve fatal error messages of symbol_why.py

Message ID 20221024113215.2116725-1-jose.quaresma@foundries.io
State Accepted, archived
Commit 54ae08779071f2e97bff0ff6514ede3124312c3b
Headers show
Series [v2] kernel-yocto: improve fatal error messages of symbol_why.py | expand

Commit Message

Jose Quaresma Oct. 24, 2022, 11:32 a.m. UTC
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 <jose.quaresma@foundries.io>
---

v2: get cmd from the exception CalledProcessError

 meta/classes/kernel-yocto.bbclass | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Ross Burton Oct. 24, 2022, 3:19 p.m. UTC | #1
On 24 Oct 2022, at 12:32, Jose Quaresma via lists.openembedded.org <quaresma.jose=gmail.com@lists.openembedded.org> wrote:
> 
> 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 <jose.quaresma@foundries.io>

$ git am -s v2_20221024_quaresma_jose_kernel_yocto_improve_fatal_error_messages_of_symbol_why_py.mbx
Applying: kernel-yocto: improve fatal error messages of symbol_why.py
error: meta/classes/kernel-yocto.bbclass: does not exist in index

Can you rebase this to current master? That file hasn’t existed since August.

Ross
Jose Quaresma Oct. 24, 2022, 3:56 p.m. UTC | #2
Ross Burton <Ross.Burton@arm.com> escreveu no dia segunda, 24/10/2022 à(s)
16:20:

> On 24 Oct 2022, at 12:32, Jose Quaresma via lists.openembedded.org
> <quaresma.jose=gmail.com@lists.openembedded.org> wrote:
> >
> > 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 <jose.quaresma@foundries.io>
>
> $ git am -s
> v2_20221024_quaresma_jose_kernel_yocto_improve_fatal_error_messages_of_symbol_why_py.mbx
> Applying: kernel-yocto: improve fatal error messages of symbol_why.py
> error: meta/classes/kernel-yocto.bbclass: does not exist in index
>
> Can you rebase this to current master? That file hasn’t existed since
> August.
>

I sent it from kirstone, fixed in v3. Sorry for that.

Jose


>
> Ross
>
>
diff mbox series

Patch

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index e8046bb8f6..82e792351f 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -500,7 +500,7 @@  python do_config_analysis() {
                 try:
                     analysis = subprocess.check_output(['symbol_why.py', '--dotconfig',  '{}'.format( d.getVar('B') + '/.config' ), '--blame', c], 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(e.cmd), e.output.decode('utf-8')))
 
                 outfile = d.getVar( 'CONFIG_ANALYSIS_FILE' )
 
@@ -508,7 +508,7 @@  python do_config_analysis() {
                 try:
                     analysis = subprocess.check_output(['symbol_why.py', '--dotconfig',  '{}'.format( d.getVar('B') + '/.config' ), '--summary', '--extended', '--sanity', c], 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(e.cmd), e.output.decode('utf-8')))
 
                 outfile = d.getVar( 'CONFIG_AUDIT_FILE' )
 
@@ -569,7 +569,7 @@  python do_kernel_configcheck() {
     try:
         analysis = subprocess.check_output(['symbol_why.py', '--dotconfig',  '{}'.format( d.getVar('B') + '/.config' ), '--mismatches', extra_params], 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(e.cmd), e.output.decode('utf-8')))
 
     if analysis:
         outfile = "{}/{}/cfg/mismatch.txt".format( s, kmeta )
@@ -591,7 +591,7 @@  python do_kernel_configcheck() {
     try:
         analysis = subprocess.check_output(['symbol_why.py', '--dotconfig',  '{}'.format( d.getVar('B') + '/.config' ), '--invalid', extra_params], 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(e.cmd), e.output.decode('utf-8')))
 
     if analysis:
         outfile = "{}/{}/cfg/invalid.txt".format(s,kmeta)
@@ -610,7 +610,7 @@  python do_kernel_configcheck() {
     try:
         analysis = subprocess.check_output(['symbol_why.py', '--dotconfig',  '{}'.format( d.getVar('B') + '/.config' ), '--sanity'], 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(e.cmd), e.output.decode('utf-8')))
 
     if analysis:
         outfile = "{}/{}/cfg/redefinition.txt".format(s,kmeta)