summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2021-02-09 09:50:21 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-10 23:48:16 +0000
commit75f87db413f3659fee18eff389b7b339b01cce15 (patch)
treee733135549b516c72c4f34172b6bbf865377fc76 /bitbake/lib/bb/runqueue.py
parent7283a0b3b6ca49d0d2e13593333a580ef10439a8 (diff)
downloadpoky-75f87db413f3659fee18eff389b7b339b01cce15.tar.gz
bitbake: logging: Make bitbake logger compatible with python logger
The bitbake logger overrode the definition of the debug() logging call to include a debug level, but this causes problems with code that may be using standard python logging, since the extra argument is interpreted differently. Instead, change the bitbake loggers debug() call to match the python logger call and add a debug2() and debug3() API to replace calls that were logging to a different debug level. [RP: Small fix to ensure bb.debug calls bbdebug()] (Bitbake rev: f68682a79d83e6399eb403f30a1f113516575f51) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py64
1 files changed, 32 insertions, 32 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 7d493eb402..2f521e5a14 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -544,8 +544,8 @@ class RunQueueData:
544 for tid in self.runtaskentries: 544 for tid in self.runtaskentries:
545 if task_done[tid] is False or deps_left[tid] != 0: 545 if task_done[tid] is False or deps_left[tid] != 0:
546 problem_tasks.append(tid) 546 problem_tasks.append(tid)
547 logger.debug(2, "Task %s is not buildable", tid) 547 logger.debug2("Task %s is not buildable", tid)
548 logger.debug(2, "(Complete marker was %s and the remaining dependency count was %s)\n", task_done[tid], deps_left[tid]) 548 logger.debug2("(Complete marker was %s and the remaining dependency count was %s)\n", task_done[tid], deps_left[tid])
549 self.runtaskentries[tid].weight = weight[tid] 549 self.runtaskentries[tid].weight = weight[tid]
550 550
551 if problem_tasks: 551 if problem_tasks:
@@ -643,7 +643,7 @@ class RunQueueData:
643 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) 643 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
644 #runtid = build_tid(mc, fn, taskname) 644 #runtid = build_tid(mc, fn, taskname)
645 645
646 #logger.debug(2, "Processing %s,%s:%s", mc, fn, taskname) 646 #logger.debug2("Processing %s,%s:%s", mc, fn, taskname)
647 647
648 depends = set() 648 depends = set()
649 task_deps = self.dataCaches[mc].task_deps[taskfn] 649 task_deps = self.dataCaches[mc].task_deps[taskfn]
@@ -1199,9 +1199,9 @@ class RunQueueData:
1199 """ 1199 """
1200 Dump some debug information on the internal data structures 1200 Dump some debug information on the internal data structures
1201 """ 1201 """
1202 logger.debug(3, "run_tasks:") 1202 logger.debug3("run_tasks:")
1203 for tid in self.runtaskentries: 1203 for tid in self.runtaskentries:
1204 logger.debug(3, " %s: %s Deps %s RevDeps %s", tid, 1204 logger.debug3(" %s: %s Deps %s RevDeps %s", tid,
1205 self.runtaskentries[tid].weight, 1205 self.runtaskentries[tid].weight,
1206 self.runtaskentries[tid].depends, 1206 self.runtaskentries[tid].depends,
1207 self.runtaskentries[tid].revdeps) 1207 self.runtaskentries[tid].revdeps)
@@ -1238,7 +1238,7 @@ class RunQueue:
1238 self.fakeworker = {} 1238 self.fakeworker = {}
1239 1239
1240 def _start_worker(self, mc, fakeroot = False, rqexec = None): 1240 def _start_worker(self, mc, fakeroot = False, rqexec = None):
1241 logger.debug(1, "Starting bitbake-worker") 1241 logger.debug("Starting bitbake-worker")
1242 magic = "decafbad" 1242 magic = "decafbad"
1243 if self.cooker.configuration.profile: 1243 if self.cooker.configuration.profile:
1244 magic = "decafbadbad" 1244 magic = "decafbadbad"
@@ -1283,7 +1283,7 @@ class RunQueue:
1283 def _teardown_worker(self, worker): 1283 def _teardown_worker(self, worker):
1284 if not worker: 1284 if not worker:
1285 return 1285 return
1286 logger.debug(1, "Teardown for bitbake-worker") 1286 logger.debug("Teardown for bitbake-worker")
1287 try: 1287 try:
1288 worker.process.stdin.write(b"<quit></quit>") 1288 worker.process.stdin.write(b"<quit></quit>")
1289 worker.process.stdin.flush() 1289 worker.process.stdin.flush()
@@ -1356,12 +1356,12 @@ class RunQueue:
1356 1356
1357 # If the stamp is missing, it's not current 1357 # If the stamp is missing, it's not current
1358 if not os.access(stampfile, os.F_OK): 1358 if not os.access(stampfile, os.F_OK):
1359 logger.debug(2, "Stampfile %s not available", stampfile) 1359 logger.debug2("Stampfile %s not available", stampfile)
1360 return False 1360 return False
1361 # If it's a 'nostamp' task, it's not current 1361 # If it's a 'nostamp' task, it's not current
1362 taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn] 1362 taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
1363 if 'nostamp' in taskdep and taskname in taskdep['nostamp']: 1363 if 'nostamp' in taskdep and taskname in taskdep['nostamp']:
1364 logger.debug(2, "%s.%s is nostamp\n", fn, taskname) 1364 logger.debug2("%s.%s is nostamp\n", fn, taskname)
1365 return False 1365 return False
1366 1366
1367 if taskname != "do_setscene" and taskname.endswith("_setscene"): 1367 if taskname != "do_setscene" and taskname.endswith("_setscene"):
@@ -1385,18 +1385,18 @@ class RunQueue:
1385 continue 1385 continue
1386 if fn == fn2 or (fulldeptree and fn2 not in stampwhitelist): 1386 if fn == fn2 or (fulldeptree and fn2 not in stampwhitelist):
1387 if not t2: 1387 if not t2:
1388 logger.debug(2, 'Stampfile %s does not exist', stampfile2) 1388 logger.debug2('Stampfile %s does not exist', stampfile2)
1389 iscurrent = False 1389 iscurrent = False
1390 break 1390 break
1391 if t1 < t2: 1391 if t1 < t2:
1392 logger.debug(2, 'Stampfile %s < %s', stampfile, stampfile2) 1392 logger.debug2('Stampfile %s < %s', stampfile, stampfile2)
1393 iscurrent = False 1393 iscurrent = False
1394 break 1394 break
1395 if recurse and iscurrent: 1395 if recurse and iscurrent:
1396 if dep in cache: 1396 if dep in cache:
1397 iscurrent = cache[dep] 1397 iscurrent = cache[dep]
1398 if not iscurrent: 1398 if not iscurrent:
1399 logger.debug(2, 'Stampfile for dependency %s:%s invalid (cached)' % (fn2, taskname2)) 1399 logger.debug2('Stampfile for dependency %s:%s invalid (cached)' % (fn2, taskname2))
1400 else: 1400 else:
1401 iscurrent = self.check_stamp_task(dep, recurse=True, cache=cache) 1401 iscurrent = self.check_stamp_task(dep, recurse=True, cache=cache)
1402 cache[dep] = iscurrent 1402 cache[dep] = iscurrent
@@ -1761,7 +1761,7 @@ class RunQueueExecute:
1761 for scheduler in schedulers: 1761 for scheduler in schedulers:
1762 if self.scheduler == scheduler.name: 1762 if self.scheduler == scheduler.name:
1763 self.sched = scheduler(self, self.rqdata) 1763 self.sched = scheduler(self, self.rqdata)
1764 logger.debug(1, "Using runqueue scheduler '%s'", scheduler.name) 1764 logger.debug("Using runqueue scheduler '%s'", scheduler.name)
1765 break 1765 break
1766 else: 1766 else:
1767 bb.fatal("Invalid scheduler '%s'. Available schedulers: %s" % 1767 bb.fatal("Invalid scheduler '%s'. Available schedulers: %s" %
@@ -1899,7 +1899,7 @@ class RunQueueExecute:
1899 break 1899 break
1900 if alldeps: 1900 if alldeps:
1901 self.setbuildable(revdep) 1901 self.setbuildable(revdep)
1902 logger.debug(1, "Marking task %s as buildable", revdep) 1902 logger.debug("Marking task %s as buildable", revdep)
1903 1903
1904 def task_complete(self, task): 1904 def task_complete(self, task):
1905 self.stats.taskCompleted() 1905 self.stats.taskCompleted()
@@ -1929,7 +1929,7 @@ class RunQueueExecute:
1929 def summarise_scenequeue_errors(self): 1929 def summarise_scenequeue_errors(self):
1930 err = False 1930 err = False
1931 if not self.sqdone: 1931 if not self.sqdone:
1932 logger.debug(1, 'We could skip tasks %s', "\n".join(sorted(self.scenequeue_covered))) 1932 logger.debug('We could skip tasks %s', "\n".join(sorted(self.scenequeue_covered)))
1933 completeevent = sceneQueueComplete(self.sq_stats, self.rq) 1933 completeevent = sceneQueueComplete(self.sq_stats, self.rq)
1934 bb.event.fire(completeevent, self.cfgData) 1934 bb.event.fire(completeevent, self.cfgData)
1935 if self.sq_deferred: 1935 if self.sq_deferred:
@@ -1986,7 +1986,7 @@ class RunQueueExecute:
1986 if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values(): 1986 if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values():
1987 if nexttask not in self.sqdata.unskippable and len(self.sqdata.sq_revdeps[nexttask]) > 0 and self.sqdata.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and self.check_dependencies(nexttask, self.sqdata.sq_revdeps[nexttask]): 1987 if nexttask not in self.sqdata.unskippable and len(self.sqdata.sq_revdeps[nexttask]) > 0 and self.sqdata.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and self.check_dependencies(nexttask, self.sqdata.sq_revdeps[nexttask]):
1988 if nexttask not in self.rqdata.target_tids: 1988 if nexttask not in self.rqdata.target_tids:
1989 logger.debug(2, "Skipping setscene for task %s" % nexttask) 1989 logger.debug2("Skipping setscene for task %s" % nexttask)
1990 self.sq_task_skip(nexttask) 1990 self.sq_task_skip(nexttask)
1991 self.scenequeue_notneeded.add(nexttask) 1991 self.scenequeue_notneeded.add(nexttask)
1992 if nexttask in self.sq_deferred: 1992 if nexttask in self.sq_deferred:
@@ -1999,28 +1999,28 @@ class RunQueueExecute:
1999 if nexttask in self.sq_deferred: 1999 if nexttask in self.sq_deferred:
2000 if self.sq_deferred[nexttask] not in self.runq_complete: 2000 if self.sq_deferred[nexttask] not in self.runq_complete:
2001 continue 2001 continue
2002 logger.debug(1, "Task %s no longer deferred" % nexttask) 2002 logger.debug("Task %s no longer deferred" % nexttask)
2003 del self.sq_deferred[nexttask] 2003 del self.sq_deferred[nexttask]
2004 valid = self.rq.validate_hashes(set([nexttask]), self.cooker.data, 0, False, summary=False) 2004 valid = self.rq.validate_hashes(set([nexttask]), self.cooker.data, 0, False, summary=False)
2005 if not valid: 2005 if not valid:
2006 logger.debug(1, "%s didn't become valid, skipping setscene" % nexttask) 2006 logger.debug("%s didn't become valid, skipping setscene" % nexttask)
2007 self.sq_task_failoutright(nexttask) 2007 self.sq_task_failoutright(nexttask)
2008 return True 2008 return True
2009 else: 2009 else:
2010 self.sqdata.outrightfail.remove(nexttask) 2010 self.sqdata.outrightfail.remove(nexttask)
2011 if nexttask in self.sqdata.outrightfail: 2011 if nexttask in self.sqdata.outrightfail:
2012 logger.debug(2, 'No package found, so skipping setscene task %s', nexttask) 2012 logger.debug2('No package found, so skipping setscene task %s', nexttask)
2013 self.sq_task_failoutright(nexttask) 2013 self.sq_task_failoutright(nexttask)
2014 return True 2014 return True
2015 if nexttask in self.sqdata.unskippable: 2015 if nexttask in self.sqdata.unskippable:
2016 logger.debug(2, "Setscene task %s is unskippable" % nexttask) 2016 logger.debug2("Setscene task %s is unskippable" % nexttask)
2017 task = nexttask 2017 task = nexttask
2018 break 2018 break
2019 if task is not None: 2019 if task is not None:
2020 (mc, fn, taskname, taskfn) = split_tid_mcfn(task) 2020 (mc, fn, taskname, taskfn) = split_tid_mcfn(task)
2021 taskname = taskname + "_setscene" 2021 taskname = taskname + "_setscene"
2022 if self.rq.check_stamp_task(task, taskname_from_tid(task), recurse = True, cache=self.stampcache): 2022 if self.rq.check_stamp_task(task, taskname_from_tid(task), recurse = True, cache=self.stampcache):
2023 logger.debug(2, 'Stamp for underlying task %s is current, so skipping setscene variant', task) 2023 logger.debug2('Stamp for underlying task %s is current, so skipping setscene variant', task)
2024 self.sq_task_failoutright(task) 2024 self.sq_task_failoutright(task)
2025 return True 2025 return True
2026 2026
@@ -2030,12 +2030,12 @@ class RunQueueExecute:
2030 return True 2030 return True
2031 2031
2032 if self.rq.check_stamp_task(task, taskname, cache=self.stampcache): 2032 if self.rq.check_stamp_task(task, taskname, cache=self.stampcache):
2033 logger.debug(2, 'Setscene stamp current task %s, so skip it and its dependencies', task) 2033 logger.debug2('Setscene stamp current task %s, so skip it and its dependencies', task)
2034 self.sq_task_skip(task) 2034 self.sq_task_skip(task)
2035 return True 2035 return True
2036 2036
2037 if self.cooker.configuration.skipsetscene: 2037 if self.cooker.configuration.skipsetscene:
2038 logger.debug(2, 'No setscene tasks should be executed. Skipping %s', task) 2038 logger.debug2('No setscene tasks should be executed. Skipping %s', task)
2039 self.sq_task_failoutright(task) 2039 self.sq_task_failoutright(task)
2040 return True 2040 return True
2041 2041
@@ -2097,12 +2097,12 @@ class RunQueueExecute:
2097 return True 2097 return True
2098 2098
2099 if task in self.tasks_covered: 2099 if task in self.tasks_covered:
2100 logger.debug(2, "Setscene covered task %s", task) 2100 logger.debug2("Setscene covered task %s", task)
2101 self.task_skip(task, "covered") 2101 self.task_skip(task, "covered")
2102 return True 2102 return True
2103 2103
2104 if self.rq.check_stamp_task(task, taskname, cache=self.stampcache): 2104 if self.rq.check_stamp_task(task, taskname, cache=self.stampcache):
2105 logger.debug(2, "Stamp current task %s", task) 2105 logger.debug2("Stamp current task %s", task)
2106 2106
2107 self.task_skip(task, "existing") 2107 self.task_skip(task, "existing")
2108 self.runq_tasksrun.add(task) 2108 self.runq_tasksrun.add(task)
@@ -2322,7 +2322,7 @@ class RunQueueExecute:
2322 remapped = True 2322 remapped = True
2323 2323
2324 if not remapped: 2324 if not remapped:
2325 #logger.debug(1, "Task %s hash changes: %s->%s %s->%s" % (tid, orighash, newhash, origuni, newuni)) 2325 #logger.debug("Task %s hash changes: %s->%s %s->%s" % (tid, orighash, newhash, origuni, newuni))
2326 self.rqdata.runtaskentries[tid].hash = newhash 2326 self.rqdata.runtaskentries[tid].hash = newhash
2327 self.rqdata.runtaskentries[tid].unihash = newuni 2327 self.rqdata.runtaskentries[tid].unihash = newuni
2328 changed.add(tid) 2328 changed.add(tid)
@@ -2337,7 +2337,7 @@ class RunQueueExecute:
2337 for mc in self.rq.fakeworker: 2337 for mc in self.rq.fakeworker:
2338 self.rq.fakeworker[mc].process.stdin.write(b"<newtaskhashes>" + pickle.dumps(bb.parse.siggen.get_taskhashes()) + b"</newtaskhashes>") 2338 self.rq.fakeworker[mc].process.stdin.write(b"<newtaskhashes>" + pickle.dumps(bb.parse.siggen.get_taskhashes()) + b"</newtaskhashes>")
2339 2339
2340 hashequiv_logger.debug(1, pprint.pformat("Tasks changed:\n%s" % (changed))) 2340 hashequiv_logger.debug(pprint.pformat("Tasks changed:\n%s" % (changed)))
2341 2341
2342 for tid in changed: 2342 for tid in changed:
2343 if tid not in self.rqdata.runq_setscene_tids: 2343 if tid not in self.rqdata.runq_setscene_tids:
@@ -2356,7 +2356,7 @@ class RunQueueExecute:
2356 # Check no tasks this covers are running 2356 # Check no tasks this covers are running
2357 for dep in self.sqdata.sq_covered_tasks[tid]: 2357 for dep in self.sqdata.sq_covered_tasks[tid]:
2358 if dep in self.runq_running and dep not in self.runq_complete: 2358 if dep in self.runq_running and dep not in self.runq_complete:
2359 hashequiv_logger.debug(2, "Task %s is running which blocks setscene for %s from running" % (dep, tid)) 2359 hashequiv_logger.debug2("Task %s is running which blocks setscene for %s from running" % (dep, tid))
2360 valid = False 2360 valid = False
2361 break 2361 break
2362 if not valid: 2362 if not valid:
@@ -2430,7 +2430,7 @@ class RunQueueExecute:
2430 2430
2431 for dep in sorted(self.sqdata.sq_deps[task]): 2431 for dep in sorted(self.sqdata.sq_deps[task]):
2432 if fail and task in self.sqdata.sq_harddeps and dep in self.sqdata.sq_harddeps[task]: 2432 if fail and task in self.sqdata.sq_harddeps and dep in self.sqdata.sq_harddeps[task]:
2433 logger.debug(2, "%s was unavailable and is a hard dependency of %s so skipping" % (task, dep)) 2433 logger.debug2("%s was unavailable and is a hard dependency of %s so skipping" % (task, dep))
2434 self.sq_task_failoutright(dep) 2434 self.sq_task_failoutright(dep)
2435 continue 2435 continue
2436 if self.sqdata.sq_revdeps[dep].issubset(self.scenequeue_covered | self.scenequeue_notcovered): 2436 if self.sqdata.sq_revdeps[dep].issubset(self.scenequeue_covered | self.scenequeue_notcovered):
@@ -2460,7 +2460,7 @@ class RunQueueExecute:
2460 completed dependencies as buildable 2460 completed dependencies as buildable
2461 """ 2461 """
2462 2462
2463 logger.debug(1, 'Found task %s which could be accelerated', task) 2463 logger.debug('Found task %s which could be accelerated', task)
2464 self.scenequeue_covered.add(task) 2464 self.scenequeue_covered.add(task)
2465 self.scenequeue_updatecounters(task) 2465 self.scenequeue_updatecounters(task)
2466 2466
@@ -2775,13 +2775,13 @@ def update_scenequeue_data(tids, sqdata, rqdata, rq, cooker, stampcache, sqrq, s
2775 continue 2775 continue
2776 2776
2777 if rq.check_stamp_task(tid, taskname + "_setscene", cache=stampcache): 2777 if rq.check_stamp_task(tid, taskname + "_setscene", cache=stampcache):
2778 logger.debug(2, 'Setscene stamp current for task %s', tid) 2778 logger.debug2('Setscene stamp current for task %s', tid)
2779 sqdata.stamppresent.add(tid) 2779 sqdata.stamppresent.add(tid)
2780 sqrq.sq_task_skip(tid) 2780 sqrq.sq_task_skip(tid)
2781 continue 2781 continue
2782 2782
2783 if rq.check_stamp_task(tid, taskname, recurse = True, cache=stampcache): 2783 if rq.check_stamp_task(tid, taskname, recurse = True, cache=stampcache):
2784 logger.debug(2, 'Normal stamp current for task %s', tid) 2784 logger.debug2('Normal stamp current for task %s', tid)
2785 sqdata.stamppresent.add(tid) 2785 sqdata.stamppresent.add(tid)
2786 sqrq.sq_task_skip(tid) 2786 sqrq.sq_task_skip(tid)
2787 continue 2787 continue