bitbake: lib/bb: Replace "ABORT" action in BB_DISKMON_DIRS

In line with the inclusive language migration defined at:

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

replace the "ABORT" action in BB_DISKMON_DIRS entries with "HALT".
In order to ease migration, code has been added to warn users to
update their configurations if the old name is used, as opposed to
to throwing an error.

(Bitbake rev: 11dc65dc077398ff9818060769c99c0090291186)

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:34 -05:00
committed by Richard Purdie
parent 424269caea
commit 4f77505d94
3 changed files with 17 additions and 12 deletions

View File

@@ -138,7 +138,7 @@ overview of their function and contents.
where: where:
<action> is: <action> is:
ABORT: Immediately abort the build when HALT: Immediately halt the build when
a threshold is broken. a threshold is broken.
STOPTASKS: Stop the build after the currently STOPTASKS: Stop the build after the currently
executing tasks have finished when executing tasks have finished when
@@ -169,13 +169,13 @@ overview of their function and contents.
Here are some examples:: Here are some examples::
BB_DISKMON_DIRS = "ABORT,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K" BB_DISKMON_DIRS = "HALT,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K"
BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G" BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G"
BB_DISKMON_DIRS = "ABORT,${TMPDIR},,100K" BB_DISKMON_DIRS = "HALT,${TMPDIR},,100K"
The first example works only if you also set the The first example works only if you also set the
:term:`BB_DISKMON_WARNINTERVAL` :term:`BB_DISKMON_WARNINTERVAL`
variable. This example causes the build system to immediately abort variable. This example causes the build system to immediately halt
when either the disk space in ``${TMPDIR}`` drops below 1 Gbyte or when either the disk space in ``${TMPDIR}`` drops below 1 Gbyte or
the available free inodes drops below 100 Kbytes. Because two the available free inodes drops below 100 Kbytes. Because two
directories are provided with the variable, the build system also directories are provided with the variable, the build system also
@@ -189,7 +189,7 @@ overview of their function and contents.
directory drops below 1 Gbyte. No disk monitoring occurs for the free directory drops below 1 Gbyte. No disk monitoring occurs for the free
inodes in this case. inodes in this case.
The final example immediately aborts the build when the number of The final example immediately halts the build when the number of
free inodes in the ``${TMPDIR}`` directory drops below 100 Kbytes. No free inodes in the ``${TMPDIR}`` directory drops below 100 Kbytes. No
disk space monitoring for the directory itself occurs in this case. disk space monitoring for the directory itself occurs in this case.

View File

@@ -486,7 +486,7 @@ class BuildCompleted(BuildBase, OperationCompleted):
BuildBase.__init__(self, n, p, failures) BuildBase.__init__(self, n, p, failures)
class DiskFull(Event): class DiskFull(Event):
"""Disk full case build aborted""" """Disk full case build halted"""
def __init__(self, dev, type, freespace, mountpoint): def __init__(self, dev, type, freespace, mountpoint):
Event.__init__(self) Event.__init__(self)
self._dev = dev self._dev = dev

View File

@@ -76,7 +76,12 @@ def getDiskData(BBDirs):
return None return None
action = pathSpaceInodeRe.group(1) action = pathSpaceInodeRe.group(1)
if action not in ("ABORT", "STOPTASKS", "WARN"): if action == "ABORT":
# Emit a deprecation warning
logger.warnonce("The BB_DISKMON_DIRS \"ABORT\" action has been been renamed to \"HALT\", update configuration")
action = "HALT"
if action not in ("HALT", "STOPTASKS", "WARN"):
printErr("Unknown disk space monitor action: %s" % action) printErr("Unknown disk space monitor action: %s" % action)
return None return None
@@ -177,7 +182,7 @@ class diskMonitor:
# use them to avoid printing too many warning messages # use them to avoid printing too many warning messages
self.preFreeS = {} self.preFreeS = {}
self.preFreeI = {} self.preFreeI = {}
# This is for STOPTASKS and ABORT, to avoid printing the message # This is for STOPTASKS and HALT, to avoid printing the message
# repeatedly while waiting for the tasks to finish # repeatedly while waiting for the tasks to finish
self.checked = {} self.checked = {}
for k in self.devDict: for k in self.devDict:
@@ -219,8 +224,8 @@ class diskMonitor:
self.checked[k] = True self.checked[k] = True
rq.finish_runqueue(False) rq.finish_runqueue(False)
bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration) bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration)
elif action == "ABORT" and not self.checked[k]: elif action == "HALT" and not self.checked[k]:
logger.error("Immediately abort since the disk space monitor action is \"ABORT\"!") logger.error("Immediately halt since the disk space monitor action is \"HALT\"!")
self.checked[k] = True self.checked[k] = True
rq.finish_runqueue(True) rq.finish_runqueue(True)
bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration) bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration)
@@ -245,8 +250,8 @@ class diskMonitor:
self.checked[k] = True self.checked[k] = True
rq.finish_runqueue(False) rq.finish_runqueue(False)
bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration) bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration)
elif action == "ABORT" and not self.checked[k]: elif action == "HALT" and not self.checked[k]:
logger.error("Immediately abort since the disk space monitor action is \"ABORT\"!") logger.error("Immediately halt since the disk space monitor action is \"HALT\"!")
self.checked[k] = True self.checked[k] = True
rq.finish_runqueue(True) rq.finish_runqueue(True)
bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration) bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration)