diff mbox series

[2/3] event/runqueue: remove unused 'd' arg from check_for_interrupts

Message ID 20250806145308.2052128-2-chris.laplante@agilent.com
State Accepted, archived
Commit e0c5e94cc14dd6b1cbde491073c1f9407c97e428
Headers show
Series [1/3] cooker: remove some redundant control flow | expand

Commit Message

chris.laplante@agilent.com Aug. 6, 2025, 2:53 p.m. UTC
From: Chris Laplante <chris.laplante@agilent.com>

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
---
 lib/bb/event.py    |  2 +-
 lib/bb/runqueue.py | 32 ++++++++++++++++----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

Comments

Mathieu Dubois-Briand Aug. 7, 2025, 7:08 a.m. UTC | #1
On Wed Aug 6, 2025 at 4:53 PM CEST, Chris Laplante via lists.openembedded.org wrote:
> From: Chris Laplante <chris.laplante@agilent.com>
>
> Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
> ---

Hi Chris,

Thanks for your patches.

It looks like this is breaking several builds on the autobuilder, with
the following error:

Removing 12 recipes from the aarch64 sysroot...ERROR: Execution of event handler 'sstate_eventhandler_reachablestamps' failed
Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/meta/classes-global/sstate.bbclass", line 1301, in sstate_eventhandler_reachablestamps
    bb.event.check_for_interrupts(d)
TypeError: check_for_interrupts() takes 0 positional arguments but 1 was given

ERROR: Command execution failed: Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/bitbake/lib/bb/command.py", line 123, in runAsyncCommand
    self.cooker.updateCache()
  File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/bitbake/lib/bb/cooker.py", line 1653, in updateCache
    bb.event.fire(event, self.databuilder.mcdata[mc])
  File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/bitbake/lib/bb/event.py", line 232, in fire
    fire_class_handlers(event, d)
  File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/bitbake/lib/bb/event.py", line 131, in fire_class_handlers
    execute_handler(name, handler, event, d)
  File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/bitbake/lib/bb/event.py", line 102, in execute_handler
    ret = handler(event, d)
  File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/meta/classes-global/sstate.bbclass", line 1301, in sstate_eventhandler_reachablestamps
    bb.event.check_for_interrupts(d)
TypeError: check_for_interrupts() takes 0 positional arguments but 1 was given

Can you have a look, please?

Best regards,
Mathieu
Mathieu Dubois-Briand Aug. 7, 2025, 7:10 a.m. UTC | #2
On Thu Aug 7, 2025 at 9:08 AM CEST, Mathieu Dubois-Briand wrote:
> On Wed Aug 6, 2025 at 4:53 PM CEST, Chris Laplante via lists.openembedded.org wrote:
>> From: Chris Laplante <chris.laplante@agilent.com>
>>
>> Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
>> ---
>
> Hi Chris,
>
> Thanks for your patches.
>
> It looks like this is breaking several builds on the autobuilder, with
> the following error:
>
> Removing 12 recipes from the aarch64 sysroot...ERROR: Execution of event handler 'sstate_eventhandler_reachablestamps' failed
> Traceback (most recent call last):
>   File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/meta/classes-global/sstate.bbclass", line 1301, in sstate_eventhandler_reachablestamps
>     bb.event.check_for_interrupts(d)
> TypeError: check_for_interrupts() takes 0 positional arguments but 1 was given
>
> ERROR: Command execution failed: Traceback (most recent call last):
>   File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/bitbake/lib/bb/command.py", line 123, in runAsyncCommand
>     self.cooker.updateCache()
>   File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/bitbake/lib/bb/cooker.py", line 1653, in updateCache
>     bb.event.fire(event, self.databuilder.mcdata[mc])
>   File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/bitbake/lib/bb/event.py", line 232, in fire
>     fire_class_handlers(event, d)
>   File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/bitbake/lib/bb/event.py", line 131, in fire_class_handlers
>     execute_handler(name, handler, event, d)
>   File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/bitbake/lib/bb/event.py", line 102, in execute_handler
>     ret = handler(event, d)
>   File "/srv/pokybuild/yocto-worker/qemuarm64-armhost/build/meta/classes-global/sstate.bbclass", line 1301, in sstate_eventhandler_reachablestamps
>     bb.event.check_for_interrupts(d)
> TypeError: check_for_interrupts() takes 0 positional arguments but 1 was given
>
> Can you have a look, please?
>
> Best regards,
> Mathieu

Sorry, I forgot to add some build links:

https://autobuilder.yoctoproject.org/valkyrie/#/builders/8/builds/2200
https://autobuilder.yoctoproject.org/valkyrie/#/builders/16/builds/2201
https://autobuilder.yoctoproject.org/valkyrie/#/builders/36/builds/2171
https://autobuilder.yoctoproject.org/valkyrie/#/builders/68/builds/2238
chris.laplante@agilent.com Aug. 7, 2025, 12:52 p.m. UTC | #3
Hi Mathieu,

> > Hi Chris,
> >
> > Thanks for your patches.
> >
> > It looks like this is breaking several builds on the autobuilder, with
> > the following error:
> >
> > Removing 12 recipes from the aarch64 sysroot...ERROR: Execution of
> > event handler 'sstate_eventhandler_reachablestamps' failed Traceback (most
> recent call last):
> >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> armhost/build/meta/classes-global/sstate.bbclass", line 1301, in
> sstate_eventhandler_reachablestamps
> >     bb.event.check_for_interrupts(d)
> > TypeError: check_for_interrupts() takes 0 positional arguments but 1
> > was given
> >
> > ERROR: Command execution failed: Traceback (most recent call last):
> >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> armhost/build/bitbake/lib/bb/command.py", line 123, in runAsyncCommand
> >     self.cooker.updateCache()
> >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> armhost/build/bitbake/lib/bb/cooker.py", line 1653, in updateCache
> >     bb.event.fire(event, self.databuilder.mcdata[mc])
> >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> armhost/build/bitbake/lib/bb/event.py", line 232, in fire
> >     fire_class_handlers(event, d)
> >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> armhost/build/bitbake/lib/bb/event.py", line 131, in fire_class_handlers
> >     execute_handler(name, handler, event, d)
> >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> armhost/build/bitbake/lib/bb/event.py", line 102, in execute_handler
> >     ret = handler(event, d)
> >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> armhost/build/meta/classes-global/sstate.bbclass", line 1301, in
> sstate_eventhandler_reachablestamps
> >     bb.event.check_for_interrupts(d)
> > TypeError: check_for_interrupts() takes 0 positional arguments but 1
> > was given
> >
> > Can you have a look, please?
> >
> > Best regards,
> > Mathieu

Thanks for catching that. I forgot to check for usages in bbclasses. 

I'll work on a v2.

Thanks,
Chris
chris.laplante@agilent.com Aug. 7, 2025, 6:19 p.m. UTC | #4
Hi all,

> -----Original Message-----
> From: LAPLANTE,CHRIS (Agilent USA)
> Sent: Thursday, August 7, 2025 8:53 AM
> To: mathieu.dubois-briand@bootlin.com; bitbake-
> devel@lists.openembedded.org
> Subject: RE: [bitbake-devel] [PATCH 2/3] event/runqueue: remove unused 'd'
> arg from check_for_interrupts
> 
> Hi Mathieu,
> 
> > > Hi Chris,
> > >
> > > Thanks for your patches.
> > >
> > > It looks like this is breaking several builds on the autobuilder,
> > > with the following error:
> > >
> > > Removing 12 recipes from the aarch64 sysroot...ERROR: Execution of
> > > event handler 'sstate_eventhandler_reachablestamps' failed Traceback
> > > (most
> > recent call last):
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/meta/classes-global/sstate.bbclass", line 1301, in
> > sstate_eventhandler_reachablestamps
> > >     bb.event.check_for_interrupts(d)
> > > TypeError: check_for_interrupts() takes 0 positional arguments but 1
> > > was given
> > >
> > > ERROR: Command execution failed: Traceback (most recent call last):
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/bitbake/lib/bb/command.py", line 123, in runAsyncCommand
> > >     self.cooker.updateCache()
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/bitbake/lib/bb/cooker.py", line 1653, in updateCache
> > >     bb.event.fire(event, self.databuilder.mcdata[mc])
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/bitbake/lib/bb/event.py", line 232, in fire
> > >     fire_class_handlers(event, d)
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/bitbake/lib/bb/event.py", line 131, in
> > fire_class_handlers
> > >     execute_handler(name, handler, event, d)
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/bitbake/lib/bb/event.py", line 102, in execute_handler
> > >     ret = handler(event, d)
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/meta/classes-global/sstate.bbclass", line 1301, in
> > sstate_eventhandler_reachablestamps
> > >     bb.event.check_for_interrupts(d)
> > > TypeError: check_for_interrupts() takes 0 positional arguments but 1
> > > was given
> > >
> > > Can you have a look, please?
> > >
> > > Best regards,
> > > Mathieu
> 
> Thanks for catching that. I forgot to check for usages in bbclasses.
> 
> I'll work on a v2.

No v2 was necessary since nothing else in bitbake had to change. I sent a patch to oe-core to fix the above errors: https://patchwork.yoctoproject.org/project/oe-core/patch/20250807181256.2693568-3-chris.laplante@agilent.com/

Thanks,
Chris
Richard Purdie Aug. 12, 2025, 9:06 a.m. UTC | #5
On Thu, 2025-08-07 at 12:52 +0000, Chris Laplante via lists.openembedded.org wrote:
> Hi Mathieu,
> 
> > > Hi Chris,
> > > 
> > > Thanks for your patches.
> > > 
> > > It looks like this is breaking several builds on the autobuilder, with
> > > the following error:
> > > 
> > > Removing 12 recipes from the aarch64 sysroot...ERROR: Execution of
> > > event handler 'sstate_eventhandler_reachablestamps' failed Traceback (most
> > recent call last):
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/meta/classes-global/sstate.bbclass", line 1301, in
> > sstate_eventhandler_reachablestamps
> > >     bb.event.check_for_interrupts(d)
> > > TypeError: check_for_interrupts() takes 0 positional arguments but 1
> > > was given
> > > 
> > > ERROR: Command execution failed: Traceback (most recent call last):
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/bitbake/lib/bb/command.py", line 123, in runAsyncCommand
> > >     self.cooker.updateCache()
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/bitbake/lib/bb/cooker.py", line 1653, in updateCache
> > >     bb.event.fire(event, self.databuilder.mcdata[mc])
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/bitbake/lib/bb/event.py", line 232, in fire
> > >     fire_class_handlers(event, d)
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/bitbake/lib/bb/event.py", line 131, in fire_class_handlers
> > >     execute_handler(name, handler, event, d)
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/bitbake/lib/bb/event.py", line 102, in execute_handler
> > >     ret = handler(event, d)
> > >   File "/srv/pokybuild/yocto-worker/qemuarm64-
> > armhost/build/meta/classes-global/sstate.bbclass", line 1301, in
> > sstate_eventhandler_reachablestamps
> > >     bb.event.check_for_interrupts(d)
> > > TypeError: check_for_interrupts() takes 0 positional arguments but 1
> > > was given
> > > 
> > > Can you have a look, please?
> > > 
> > > Best regards,
> > > Mathieu
> 
> Thanks for catching that. I forgot to check for usages in bbclasses. 
> 
> I'll work on a v2.

Requiring flag days for changes like this is a bit of a pain. Since
there was a much bigger change going in, I've just taken them together
with that and bumped versions but in future, we may want to make the
parameter conditional, or add a try:/except: in the oe-core code so
that there isn't a lockstep change needed.

Cheers,

Richard
chris.laplante@agilent.com Aug. 12, 2025, 3:11 p.m. UTC | #6
Hi Richard,

> Requiring flag days for changes like this is a bit of a pain. Since there was a
> much bigger change going in, I've just taken them together with that and
> bumped versions but in future, we may want to make the parameter
> conditional, or add a try:/except: in the oe-core code so that there isn't a
> lockstep change needed.

Sorry for the trouble, but thanks for the fixup. I'll be more careful making this type of change next time.

Thanks,
Chris
diff mbox series

Patch

diff --git a/lib/bb/event.py b/lib/bb/event.py
index 2256fed76..ddf1006c2 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -90,7 +90,7 @@  def disable_heartbeat():
 # In long running code, this function should be called periodically
 # to check if we should exit due to an interuption (.e.g Ctrl+C from the UI)
 #
-def check_for_interrupts(d):
+def check_for_interrupts():
     global _should_exit
     if _should_exit.is_set():
         bb.warn("Exiting due to interrupt.")
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 80f3d3282..f37a0a706 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -678,7 +678,7 @@  class RunQueueData:
 
         self.init_progress_reporter.start()
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Step A - Work out a list of tasks to run
         #
@@ -829,7 +829,7 @@  class RunQueueData:
         #self.dump_data()
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Resolve recursive 'recrdeptask' dependencies (Part B)
         #
@@ -926,7 +926,7 @@  class RunQueueData:
             self.runtaskentries[tid].depends.difference_update(recursivetasksselfref)
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         #self.dump_data()
 
@@ -1008,7 +1008,7 @@  class RunQueueData:
                 mark_active(tid, 1)
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Step C - Prune all inactive tasks
         #
@@ -1055,7 +1055,7 @@  class RunQueueData:
                 bb.msg.fatal("RunQueue", "Could not find any tasks with the tasknames %s to run within the recipes of the taskgraphs of the targets %s" % (str(self.cooker.configuration.runall), str(self.targets)))
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Handle runonly
         if self.cooker.configuration.runonly:
@@ -1096,7 +1096,7 @@  class RunQueueData:
         logger.verbose("Assign Weightings")
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Generate a list of reverse dependencies to ease future calculations
         for tid in self.runtaskentries:
@@ -1104,7 +1104,7 @@  class RunQueueData:
                 self.runtaskentries[dep].revdeps.add(tid)
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Identify tasks at the end of dependency chains
         # Error on circular dependency loops (length two)
@@ -1121,14 +1121,14 @@  class RunQueueData:
         logger.verbose("Compute totals (have %s endpoint(s))", len(endpoints))
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Calculate task weights
         # Check of higher length circular dependencies
         self.runq_weight = self.calculate_task_weights(endpoints)
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Sanity Check - Check for multiple tasks building the same provider
         for mc in self.dataCaches:
@@ -1229,7 +1229,7 @@  class RunQueueData:
 
         self.init_progress_reporter.next_stage()
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Iterate over the task list looking for tasks with a 'setscene' function
         self.runq_setscene_tids = set()
@@ -1242,7 +1242,7 @@  class RunQueueData:
                 self.runq_setscene_tids.add(tid)
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Invalidate task if force mode active
         if self.cooker.configuration.force:
@@ -1259,7 +1259,7 @@  class RunQueueData:
                     invalidate_task(fn + ":" + st, True)
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         # Create and print to the logs a virtual/xxxx -> PN (fn) table
         for mc in taskData:
@@ -1272,7 +1272,7 @@  class RunQueueData:
                 bb.parse.siggen.tasks_resolved(virtmap, virtpnmap, self.dataCaches[mc])
 
         self.init_progress_reporter.next_stage()
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         bb.parse.siggen.set_setscene_tasks(self.runq_setscene_tids)
 
@@ -1296,7 +1296,7 @@  class RunQueueData:
                 todeal.remove(tid)
                 self.runtaskentries[tid].unihash = unihashes[tid]
 
-            bb.event.check_for_interrupts(self.cooker.data)
+            bb.event.check_for_interrupts()
 
             if time.time() > (lasttime + 30):
                 lasttime = time.time()
@@ -1555,7 +1555,7 @@  class RunQueue:
         """
 
         retval = True
-        bb.event.check_for_interrupts(self.cooker.data)
+        bb.event.check_for_interrupts()
 
         if self.state is runQueuePrepare:
             # NOTE: if you add, remove or significantly refactor the stages of this
@@ -2638,7 +2638,7 @@  class RunQueueExecute:
                 next |= self.rqdata.runtaskentries[tid].revdeps
                 total.remove(tid)
                 next.intersection_update(total)
-                bb.event.check_for_interrupts(self.cooker.data)
+                bb.event.check_for_interrupts()
 
                 if time.time() > (lasttime + 30):
                     lasttime = time.time()