bitbake: lib/bb: Replace "abort" usage in task handling

In line with the inclusive language migration defined at:

https://wiki.yoctoproject.org/wiki/Inclusive_language

replace the use of "abort" with "halt" in code related to handling
task failure.

(Bitbake rev: 831fb7f2329a3cd95b71e9c85d7d7f0d717f947f)

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Murray 2022-02-17 17:09:33 -05:00 committed by Richard Purdie
parent 09a62d96c7
commit 424269caea
5 changed files with 26 additions and 26 deletions

View File

@ -199,7 +199,7 @@ class BBCooker:
self.inotify_modified_files = [] self.inotify_modified_files = []
def _process_inotify_updates(server, cooker, abort): def _process_inotify_updates(server, cooker, halt):
cooker.process_inotify_updates() cooker.process_inotify_updates()
return 1.0 return 1.0
@ -505,7 +505,7 @@ class BBCooker:
logger.debug("Base environment change, triggering reparse") logger.debug("Base environment change, triggering reparse")
self.reset() self.reset()
def runCommands(self, server, data, abort): def runCommands(self, server, data, halt):
""" """
Run any queued asynchronous command Run any queued asynchronous command
This is done by the idle handler so it runs in true context rather than This is done by the idle handler so it runs in true context rather than
@ -578,7 +578,7 @@ class BBCooker:
if pkgs_to_build[0] in set(ignore.split()): if pkgs_to_build[0] in set(ignore.split()):
bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0]) bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0])
taskdata, runlist = self.buildTaskData(pkgs_to_build, None, self.configuration.abort, allowincomplete=True) taskdata, runlist = self.buildTaskData(pkgs_to_build, None, self.configuration.halt, allowincomplete=True)
mc = runlist[0][0] mc = runlist[0][0]
fn = runlist[0][3] fn = runlist[0][3]
@ -616,7 +616,7 @@ class BBCooker:
self.disableDataTracking() self.disableDataTracking()
self.reset() self.reset()
def buildTaskData(self, pkgs_to_build, task, abort, allowincomplete=False): def buildTaskData(self, pkgs_to_build, task, halt, allowincomplete=False):
""" """
Prepare a runqueue and taskdata object for iteration over pkgs_to_build Prepare a runqueue and taskdata object for iteration over pkgs_to_build
""" """
@ -663,7 +663,7 @@ class BBCooker:
localdata = {} localdata = {}
for mc in self.multiconfigs: for mc in self.multiconfigs:
taskdata[mc] = bb.taskdata.TaskData(abort, skiplist=self.skiplist, allowincomplete=allowincomplete) taskdata[mc] = bb.taskdata.TaskData(halt, skiplist=self.skiplist, allowincomplete=allowincomplete)
localdata[mc] = data.createCopy(self.databuilder.mcdata[mc]) localdata[mc] = data.createCopy(self.databuilder.mcdata[mc])
bb.data.expandKeys(localdata[mc]) bb.data.expandKeys(localdata[mc])
@ -737,7 +737,7 @@ class BBCooker:
Prepare a runqueue and taskdata object for iteration over pkgs_to_build Prepare a runqueue and taskdata object for iteration over pkgs_to_build
""" """
# We set abort to False here to prevent unbuildable targets raising # We set halt to False here to prevent unbuildable targets raising
# an exception when we're just generating data # an exception when we're just generating data
taskdata, runlist = self.buildTaskData(pkgs_to_build, task, False, allowincomplete=True) taskdata, runlist = self.buildTaskData(pkgs_to_build, task, False, allowincomplete=True)
@ -1425,7 +1425,7 @@ class BBCooker:
# Setup taskdata structure # Setup taskdata structure
taskdata = {} taskdata = {}
taskdata[mc] = bb.taskdata.TaskData(self.configuration.abort) taskdata[mc] = bb.taskdata.TaskData(self.configuration.halt)
taskdata[mc].add_provider(self.databuilder.mcdata[mc], self.recipecaches[mc], item) taskdata[mc].add_provider(self.databuilder.mcdata[mc], self.recipecaches[mc], item)
if quietlog: if quietlog:
@ -1441,11 +1441,11 @@ class BBCooker:
rq = bb.runqueue.RunQueue(self, self.data, self.recipecaches, taskdata, runlist) rq = bb.runqueue.RunQueue(self, self.data, self.recipecaches, taskdata, runlist)
def buildFileIdle(server, rq, abort): def buildFileIdle(server, rq, halt):
msg = None msg = None
interrupted = 0 interrupted = 0
if abort or self.state == state.forceshutdown: if halt or self.state == state.forceshutdown:
rq.finish_runqueue(True) rq.finish_runqueue(True)
msg = "Forced shutdown" msg = "Forced shutdown"
interrupted = 2 interrupted = 2
@ -1487,10 +1487,10 @@ class BBCooker:
Attempt to build the targets specified Attempt to build the targets specified
""" """
def buildTargetsIdle(server, rq, abort): def buildTargetsIdle(server, rq, halt):
msg = None msg = None
interrupted = 0 interrupted = 0
if abort or self.state == state.forceshutdown: if halt or self.state == state.forceshutdown:
rq.finish_runqueue(True) rq.finish_runqueue(True)
msg = "Forced shutdown" msg = "Forced shutdown"
interrupted = 2 interrupted = 2
@ -1533,7 +1533,7 @@ class BBCooker:
bb.event.fire(bb.event.BuildInit(packages), self.data) bb.event.fire(bb.event.BuildInit(packages), self.data)
taskdata, runlist = self.buildTaskData(targets, task, self.configuration.abort) taskdata, runlist = self.buildTaskData(targets, task, self.configuration.halt)
buildname = self.data.getVar("BUILDNAME", False) buildname = self.data.getVar("BUILDNAME", False)

View File

@ -57,7 +57,7 @@ class ConfigParameters(object):
def updateToServer(self, server, environment): def updateToServer(self, server, environment):
options = {} options = {}
for o in ["abort", "force", "invalidate_stamp", for o in ["halt", "force", "invalidate_stamp",
"dry_run", "dump_signatures", "dry_run", "dump_signatures",
"extra_assume_provided", "profile", "extra_assume_provided", "profile",
"prefile", "postfile", "server_timeout", "prefile", "postfile", "server_timeout",
@ -124,7 +124,7 @@ class CookerConfiguration(object):
self.prefile = [] self.prefile = []
self.postfile = [] self.postfile = []
self.cmd = None self.cmd = None
self.abort = True self.halt = True
self.force = False self.force = False
self.profile = False self.profile = False
self.nosetscene = False self.nosetscene = False

View File

@ -127,7 +127,7 @@ def create_bitbake_parser():
help="Execute tasks from a specific .bb recipe directly. WARNING: Does " help="Execute tasks from a specific .bb recipe directly. WARNING: Does "
"not handle any dependencies from other recipes.") "not handle any dependencies from other recipes.")
parser.add_option("-k", "--continue", action="store_false", dest="abort", default=True, parser.add_option("-k", "--continue", action="store_false", dest="halt", default=True,
help="Continue as much as possible after an error. While the target that " help="Continue as much as possible after an error. While the target that "
"failed and anything depending on it cannot be built, as much as " "failed and anything depending on it cannot be built, as much as "
"possible will be built before stopping.") "possible will be built before stopping.")

View File

@ -485,7 +485,7 @@ class RunQueueData:
msgs.append(" Task %s (dependent Tasks %s)\n" % (dep, self.runq_depends_names(self.runtaskentries[dep].depends))) msgs.append(" Task %s (dependent Tasks %s)\n" % (dep, self.runq_depends_names(self.runtaskentries[dep].depends)))
msgs.append("\n") msgs.append("\n")
if len(valid_chains) > 10: if len(valid_chains) > 10:
msgs.append("Aborted dependency loops search after 10 matches.\n") msgs.append("Halted dependency loops search after 10 matches.\n")
raise TooManyLoops raise TooManyLoops
continue continue
scan = False scan = False
@ -989,7 +989,7 @@ class RunQueueData:
# Check to make sure we still have tasks to run # Check to make sure we still have tasks to run
if not self.runtaskentries: if not self.runtaskentries:
if not taskData[''].abort: if not taskData[''].halt:
bb.msg.fatal("RunQueue", "All buildable tasks have been run but the build is incomplete (--continue mode). Errors for the tasks that failed will have been printed above.") bb.msg.fatal("RunQueue", "All buildable tasks have been run but the build is incomplete (--continue mode). Errors for the tasks that failed will have been printed above.")
else: else:
bb.msg.fatal("RunQueue", "No active tasks and not in --continue mode?! Please report this bug.") bb.msg.fatal("RunQueue", "No active tasks and not in --continue mode?! Please report this bug.")
@ -1424,7 +1424,7 @@ class RunQueue:
""" """
Run the tasks in a queue prepared by rqdata.prepare() Run the tasks in a queue prepared by rqdata.prepare()
Upon failure, optionally try to recover the build using any alternate providers Upon failure, optionally try to recover the build using any alternate providers
(if the abort on failure configuration option isn't set) (if the halt on failure configuration option isn't set)
""" """
retval = True retval = True
@ -1929,7 +1929,7 @@ class RunQueueExecute:
bb.event.fire(runQueueTaskFailed(task, self.stats, exitcode, self.rq, fakeroot_log=("".join(fakeroot_log) or None)), self.cfgData) bb.event.fire(runQueueTaskFailed(task, self.stats, exitcode, self.rq, fakeroot_log=("".join(fakeroot_log) or None)), self.cfgData)
if self.rqdata.taskData[''].abort: if self.rqdata.taskData[''].halt:
self.rq.state = runQueueCleanUp self.rq.state = runQueueCleanUp
def task_skip(self, task, reason): def task_skip(self, task, reason):
@ -2392,7 +2392,7 @@ class RunQueueExecute:
self.tasks_scenequeue_done.remove(tid) self.tasks_scenequeue_done.remove(tid)
for dep in self.sqdata.sq_covered_tasks[tid]: for dep in self.sqdata.sq_covered_tasks[tid]:
if dep in self.runq_complete and dep not in self.runq_tasksrun: if dep in self.runq_complete and dep not in self.runq_tasksrun:
bb.error("Task %s marked as completed but now needing to rerun? Aborting build." % dep) bb.error("Task %s marked as completed but now needing to rerun? Halting build." % dep)
self.failed_tids.append(tid) self.failed_tids.append(tid)
self.rq.state = runQueueCleanUp self.rq.state = runQueueCleanUp
return return
@ -2710,7 +2710,7 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq):
if tid in rqdata.runq_setscene_tids: if tid in rqdata.runq_setscene_tids:
pass pass
elif sq_revdeps_squash[tid]: elif sq_revdeps_squash[tid]:
bb.msg.fatal("RunQueue", "Something went badly wrong during scenequeue generation, aborting. Please report this problem.") bb.msg.fatal("RunQueue", "Something went badly wrong during scenequeue generation, halting. Please report this problem.")
else: else:
del sq_revdeps_squash[tid] del sq_revdeps_squash[tid]
rqdata.init_progress_reporter.update(taskcounter) rqdata.init_progress_reporter.update(taskcounter)

View File

@ -39,7 +39,7 @@ class TaskData:
""" """
BitBake Task Data implementation BitBake Task Data implementation
""" """
def __init__(self, abort = True, skiplist = None, allowincomplete = False): def __init__(self, halt = True, skiplist = None, allowincomplete = False):
self.build_targets = {} self.build_targets = {}
self.run_targets = {} self.run_targets = {}
@ -57,7 +57,7 @@ class TaskData:
self.failed_rdeps = [] self.failed_rdeps = []
self.failed_fns = [] self.failed_fns = []
self.abort = abort self.halt = halt
self.allowincomplete = allowincomplete self.allowincomplete = allowincomplete
self.skiplist = skiplist self.skiplist = skiplist
@ -328,7 +328,7 @@ class TaskData:
try: try:
self.add_provider_internal(cfgData, dataCache, item) self.add_provider_internal(cfgData, dataCache, item)
except bb.providers.NoProvider: except bb.providers.NoProvider:
if self.abort: if self.halt:
raise raise
self.remove_buildtarget(item) self.remove_buildtarget(item)
@ -479,7 +479,7 @@ class TaskData:
fn = tid.rsplit(":",1)[0] fn = tid.rsplit(":",1)[0]
self.fail_fn(fn, missing_list) self.fail_fn(fn, missing_list)
if self.abort and target in self.external_targets: if self.halt and target in self.external_targets:
logger.error("Required build target '%s' has no buildable providers.\nMissing or unbuildable dependency chain was: %s", target, missing_list) logger.error("Required build target '%s' has no buildable providers.\nMissing or unbuildable dependency chain was: %s", target, missing_list)
raise bb.providers.NoProvider(target) raise bb.providers.NoProvider(target)
@ -516,7 +516,7 @@ class TaskData:
self.add_provider_internal(cfgData, dataCache, target) self.add_provider_internal(cfgData, dataCache, target)
added = added + 1 added = added + 1
except bb.providers.NoProvider: except bb.providers.NoProvider:
if self.abort and target in self.external_targets and not self.allowincomplete: if self.halt and target in self.external_targets and not self.allowincomplete:
raise raise
if not self.allowincomplete: if not self.allowincomplete:
self.remove_buildtarget(target) self.remove_buildtarget(target)