All of lore.kernel.org
 help / color / mirror / Atom feed
* [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant
@ 2023-02-07  9:50 Mikko Rapeli
  2023-02-07  9:50 ` [kirkstone][PATCH 2/2] bitbake: bitbake-diffsigs: break on first dependent task difference Mikko Rapeli
  2023-02-08 11:00 ` [OE-core] [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant Peter Kjellerstedt
  0 siblings, 2 replies; 4+ messages in thread
From: Mikko Rapeli @ 2023-02-07  9:50 UTC (permalink / raw)
  To: openembedded-core
  Cc: Marius Kriegerowski, Alexandre Belloni, Richard Purdie, Mikko Rapeli

From: Marius Kriegerowski <marius.kriegerowski@gmail.com>

This ignores flake8 rules:
  * E402 module level import not at top of file
  * E501 line too long

(Bitbake rev: e8b176de448dc387c7a578c92b52aef28591038f)

Signed-off-by: Marius Kriegerowski <marius.kriegerowski@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 bitbake/bin/bitbake-diffsigs | 49 ++++++++++++++++++++----------------
 1 file changed, 27 insertions(+), 22 deletions(-)

diff --git a/bitbake/bin/bitbake-diffsigs b/bitbake/bin/bitbake-diffsigs
index cf4cc706a2..fe0f33eea1 100755
--- a/bitbake/bin/bitbake-diffsigs
+++ b/bitbake/bin/bitbake-diffsigs
@@ -11,6 +11,7 @@
 import os
 import sys
 import warnings
+
 warnings.simplefilter("default")
 import argparse
 import logging
@@ -27,6 +28,7 @@ logger = bb.msg.logger_create(myname)
 
 is_dump = myname == 'bitbake-dumpsig'
 
+
 def find_siginfo(tinfoil, pn, taskname, sigs=None):
     result = None
     tinfoil.set_event_mask(['bb.event.FindSigInfoResult',
@@ -52,6 +54,7 @@ def find_siginfo(tinfoil, pn, taskname, sigs=None):
         sys.exit(2)
     return result
 
+
 def find_siginfo_task(bbhandler, pn, taskname, sig1=None, sig2=None):
     """ Find the most recent signature files for the specified PN/task """
 
@@ -63,10 +66,10 @@ def find_siginfo_task(bbhandler, pn, taskname, sig1=None, sig2=None):
         if not sigfiles:
             logger.error('No sigdata files found matching %s %s matching either %s or %s' % (pn, taskname, sig1, sig2))
             sys.exit(1)
-        elif not sig1 in sigfiles:
+        elif sig1 not in sigfiles:
             logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig1))
             sys.exit(1)
-        elif not sig2 in sigfiles:
+        elif sig2 not in sigfiles:
             logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig2))
             sys.exit(1)
         latestfiles = [sigfiles[sig1], sigfiles[sig2]]
@@ -88,9 +91,9 @@ def recursecb(key, hash1, hash2):
     recout = []
     if not hashfiles:
         recout.append("Unable to find matching sigdata for %s with hashes %s or %s" % (key, hash1, hash2))
-    elif not hash1 in hashfiles:
+    elif hash1 not in hashfiles:
         recout.append("Unable to find matching sigdata for %s with hash %s" % (key, hash1))
-    elif not hash2 in hashfiles:
+    elif hash2 not in hashfiles:
         recout.append("Unable to find matching sigdata for %s with hash %s" % (key, hash2))
     else:
         out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb, color=color)
@@ -110,36 +113,36 @@ parser.add_argument('-D', '--debug',
 
 if is_dump:
     parser.add_argument("-t", "--task",
-            help="find the signature data file for the last run of the specified task",
-            action="store", dest="taskargs", nargs=2, metavar=('recipename', 'taskname'))
+                        help="find the signature data file for the last run of the specified task",
+                        action="store", dest="taskargs", nargs=2, metavar=('recipename', 'taskname'))
 
     parser.add_argument("sigdatafile1",
-            help="Signature file to dump. Not used when using -t/--task.",
-            action="store", nargs='?', metavar="sigdatafile")
+                        help="Signature file to dump. Not used when using -t/--task.",
+                        action="store", nargs='?', metavar="sigdatafile")
 else:
     parser.add_argument('-c', '--color',
-            help='Colorize the output (where %(metavar)s is %(choices)s)',
-            choices=['auto', 'always', 'never'], default='auto', metavar='color')
+                        help='Colorize the output (where %(metavar)s is %(choices)s)',
+                        choices=['auto', 'always', 'never'], default='auto', metavar='color')
 
     parser.add_argument('-d', '--dump',
-            help='Dump the last signature data instead of comparing (equivalent to using bitbake-dumpsig)',
-            action='store_true')
+                        help='Dump the last signature data instead of comparing (equivalent to using bitbake-dumpsig)',
+                        action='store_true')
 
     parser.add_argument("-t", "--task",
-            help="find the signature data files for the last two runs of the specified task and compare them",
-            action="store", dest="taskargs", nargs=2, metavar=('recipename', 'taskname'))
+                        help="find the signature data files for the last two runs of the specified task and compare them",
+                        action="store", dest="taskargs", nargs=2, metavar=('recipename', 'taskname'))
 
     parser.add_argument("-s", "--signature",
-            help="With -t/--task, specify the signatures to look for instead of taking the last two",
-            action="store", dest="sigargs", nargs=2, metavar=('fromsig', 'tosig'))
+                        help="With -t/--task, specify the signatures to look for instead of taking the last two",
+                        action="store", dest="sigargs", nargs=2, metavar=('fromsig', 'tosig'))
 
     parser.add_argument("sigdatafile1",
-            help="First signature file to compare (or signature file to dump, if second not specified). Not used when using -t/--task.",
-            action="store", nargs='?')
+                        help="First signature file to compare (or signature file to dump, if second not specified). Not used when using -t/--task.",
+                        action="store", nargs='?')
 
     parser.add_argument("sigdatafile2",
-            help="Second signature file to compare",
-            action="store", nargs='?')
+                        help="Second signature file to compare",
+                        action="store", nargs='?')
 
 options = parser.parse_args()
 if is_dump:
@@ -157,7 +160,8 @@ if options.taskargs:
     with bb.tinfoil.Tinfoil() as tinfoil:
         tinfoil.prepare(config_only=True)
         if not options.dump and options.sigargs:
-            files = find_siginfo_task(tinfoil, options.taskargs[0], options.taskargs[1], options.sigargs[0], options.sigargs[1])
+            files = find_siginfo_task(tinfoil, options.taskargs[0], options.taskargs[1], options.sigargs[0],
+                                      options.sigargs[1])
         else:
             files = find_siginfo_task(tinfoil, options.taskargs[0], options.taskargs[1])
 
@@ -166,7 +170,8 @@ if options.taskargs:
             output = bb.siggen.dump_sigfile(files[-1])
         else:
             if len(files) < 2:
-                logger.error('Only one matching sigdata file found for the specified task (%s %s)' % (options.taskargs[0], options.taskargs[1]))
+                logger.error('Only one matching sigdata file found for the specified task (%s %s)' % (
+                    options.taskargs[0], options.taskargs[1]))
                 sys.exit(1)
 
             # Recurse into signature comparison
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [kirkstone][PATCH 2/2] bitbake: bitbake-diffsigs: break on first dependent task difference
  2023-02-07  9:50 [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant Mikko Rapeli
@ 2023-02-07  9:50 ` Mikko Rapeli
  2023-02-08 11:00 ` [OE-core] [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant Peter Kjellerstedt
  1 sibling, 0 replies; 4+ messages in thread
From: Mikko Rapeli @ 2023-02-07  9:50 UTC (permalink / raw)
  To: openembedded-core; +Cc: Schmidt, Adriaan, Richard Purdie, Mikko Rapeli

From: "Schmidt, Adriaan" <adriaan.schmidt@siemens.com>

compare_sigfiles() recursively calculates differences on all dependent
tasks with changed hashes. This is done in arbitrary/alphabetical order, and
only the last of those results is returned, while everything else is discarded.

This changes the behavior to instead return the first difference and not calculate
any more, which significantly speeds up diffs of tasks with many dependencies.

(Bitbake rev: ea6a676c9aa2864c2eff40eea41ba09ce903a651)

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 bitbake/lib/bb/siggen.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 9a20fc8e5f..fa2915d164 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -1028,6 +1028,7 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False):
                             # If a dependent hash changed, might as well print the line above and then defer to the changes in
                             # that hash since in all likelyhood, they're the same changes this task also saw.
                             output = [output[-1]] + recout
+                            break
 
     a_taint = a_data.get('taint', None)
     b_taint = b_data.get('taint', None)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [OE-core] [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant
  2023-02-07  9:50 [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant Mikko Rapeli
  2023-02-07  9:50 ` [kirkstone][PATCH 2/2] bitbake: bitbake-diffsigs: break on first dependent task difference Mikko Rapeli
@ 2023-02-08 11:00 ` Peter Kjellerstedt
  2023-02-08 11:11   ` Mikko Rapeli
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Kjellerstedt @ 2023-02-08 11:00 UTC (permalink / raw)
  To: Mikko Rapeli, openembedded-core
  Cc: Marius Kriegerowski, Alexandre Belloni, Richard Purdie

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Mikko Rapeli
> Sent: den 7 februari 2023 10:50
> To: openembedded-core@lists.openembedded.org
> Cc: Marius Kriegerowski <marius.kriegerowski@gmail.com>; Alexandre Belloni <alexandre.belloni@bootlin.com>; Richard Purdie <richard.purdie@linuxfoundation.org>; Mikko Rapeli <mikko.rapeli@linaro.org>
> Subject: [OE-core] [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant

This should be sent to the bitbake list. Also, when cherry-picking 
Bitbake changes in the poky repository, you should remove the "bitbake:" 
prefix from the subject line as it is added by combo-layer when it 
imports the commits from the bitbake repository to the poky repository.

//Peter



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant
  2023-02-08 11:00 ` [OE-core] [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant Peter Kjellerstedt
@ 2023-02-08 11:11   ` Mikko Rapeli
  0 siblings, 0 replies; 4+ messages in thread
From: Mikko Rapeli @ 2023-02-08 11:11 UTC (permalink / raw)
  To: Peter Kjellerstedt
  Cc: openembedded-core, Marius Kriegerowski, Alexandre Belloni,
	Richard Purdie

Hi,

On Wed, Feb 08, 2023 at 11:00:22AM +0000, Peter Kjellerstedt wrote:
> > -----Original Message-----
> > From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Mikko Rapeli
> > Sent: den 7 februari 2023 10:50
> > To: openembedded-core@lists.openembedded.org
> > Cc: Marius Kriegerowski <marius.kriegerowski@gmail.com>; Alexandre Belloni <alexandre.belloni@bootlin.com>; Richard Purdie <richard.purdie@linuxfoundation.org>; Mikko Rapeli <mikko.rapeli@linaro.org>
> > Subject: [OE-core] [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant
> 
> This should be sent to the bitbake list. Also, when cherry-picking 
> Bitbake changes in the poky repository, you should remove the "bitbake:" 
> prefix from the subject line as it is added by combo-layer when it 
> imports the commits from the bitbake repository to the poky repository.

Thanks, forgot all about this... I guess the version/branches is
different too.

Cheers,

-Mikko



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-08 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07  9:50 [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant Mikko Rapeli
2023-02-07  9:50 ` [kirkstone][PATCH 2/2] bitbake: bitbake-diffsigs: break on first dependent task difference Mikko Rapeli
2023-02-08 11:00 ` [OE-core] [kirkstone][PATCH 1/2] bitbake: bitbake-diffsigs: Make PEP8 compliant Peter Kjellerstedt
2023-02-08 11:11   ` Mikko Rapeli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.