summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-02-17 17:09:34 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-21 23:37:26 +0000
commit4f77505d94a8f6260933f457e9848d1d2fa98ce5 (patch)
tree89d4bbbf29d4d824e65c93754c9522993c5a3290
parent424269caeadd21b01a860d032ca81167c7ce7239 (diff)
downloadpoky-4f77505d94a8f6260933f457e9848d1d2fa98ce5.tar.gz
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>
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst10
-rw-r--r--bitbake/lib/bb/event.py2
-rw-r--r--bitbake/lib/bb/monitordisk.py17
3 files changed, 17 insertions, 12 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
index 7601d15a0e..315086a6ec 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
@@ -138,7 +138,7 @@ overview of their function and contents.
138 where: 138 where:
139 139
140 <action> is: 140 <action> is:
141 ABORT: Immediately abort the build when 141 HALT: Immediately halt the build when
142 a threshold is broken. 142 a threshold is broken.
143 STOPTASKS: Stop the build after the currently 143 STOPTASKS: Stop the build after the currently
144 executing tasks have finished when 144 executing tasks have finished when
@@ -169,13 +169,13 @@ overview of their function and contents.
169 169
170 Here are some examples:: 170 Here are some examples::
171 171
172 BB_DISKMON_DIRS = "ABORT,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K" 172 BB_DISKMON_DIRS = "HALT,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K"
173 BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G" 173 BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G"
174 BB_DISKMON_DIRS = "ABORT,${TMPDIR},,100K" 174 BB_DISKMON_DIRS = "HALT,${TMPDIR},,100K"
175 175
176 The first example works only if you also set the 176 The first example works only if you also set the
177 :term:`BB_DISKMON_WARNINTERVAL` 177 :term:`BB_DISKMON_WARNINTERVAL`
178 variable. This example causes the build system to immediately abort 178 variable. This example causes the build system to immediately halt
179 when either the disk space in ``${TMPDIR}`` drops below 1 Gbyte or 179 when either the disk space in ``${TMPDIR}`` drops below 1 Gbyte or
180 the available free inodes drops below 100 Kbytes. Because two 180 the available free inodes drops below 100 Kbytes. Because two
181 directories are provided with the variable, the build system also 181 directories are provided with the variable, the build system also
@@ -189,7 +189,7 @@ overview of their function and contents.
189 directory drops below 1 Gbyte. No disk monitoring occurs for the free 189 directory drops below 1 Gbyte. No disk monitoring occurs for the free
190 inodes in this case. 190 inodes in this case.
191 191
192 The final example immediately aborts the build when the number of 192 The final example immediately halts the build when the number of
193 free inodes in the ``${TMPDIR}`` directory drops below 100 Kbytes. No 193 free inodes in the ``${TMPDIR}`` directory drops below 100 Kbytes. No
194 disk space monitoring for the directory itself occurs in this case. 194 disk space monitoring for the directory itself occurs in this case.
195 195
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 89215e3dea..df020551e3 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -486,7 +486,7 @@ class BuildCompleted(BuildBase, OperationCompleted):
486 BuildBase.__init__(self, n, p, failures) 486 BuildBase.__init__(self, n, p, failures)
487 487
488class DiskFull(Event): 488class DiskFull(Event):
489 """Disk full case build aborted""" 489 """Disk full case build halted"""
490 def __init__(self, dev, type, freespace, mountpoint): 490 def __init__(self, dev, type, freespace, mountpoint):
491 Event.__init__(self) 491 Event.__init__(self)
492 self._dev = dev 492 self._dev = dev
diff --git a/bitbake/lib/bb/monitordisk.py b/bitbake/lib/bb/monitordisk.py
index 98f2109ed2..8d8cfbb937 100644
--- a/bitbake/lib/bb/monitordisk.py
+++ b/bitbake/lib/bb/monitordisk.py
@@ -76,7 +76,12 @@ def getDiskData(BBDirs):
76 return None 76 return None
77 77
78 action = pathSpaceInodeRe.group(1) 78 action = pathSpaceInodeRe.group(1)
79 if action not in ("ABORT", "STOPTASKS", "WARN"): 79 if action == "ABORT":
80 # Emit a deprecation warning
81 logger.warnonce("The BB_DISKMON_DIRS \"ABORT\" action has been been renamed to \"HALT\", update configuration")
82 action = "HALT"
83
84 if action not in ("HALT", "STOPTASKS", "WARN"):
80 printErr("Unknown disk space monitor action: %s" % action) 85 printErr("Unknown disk space monitor action: %s" % action)
81 return None 86 return None
82 87
@@ -177,7 +182,7 @@ class diskMonitor:
177 # use them to avoid printing too many warning messages 182 # use them to avoid printing too many warning messages
178 self.preFreeS = {} 183 self.preFreeS = {}
179 self.preFreeI = {} 184 self.preFreeI = {}
180 # This is for STOPTASKS and ABORT, to avoid printing the message 185 # This is for STOPTASKS and HALT, to avoid printing the message
181 # repeatedly while waiting for the tasks to finish 186 # repeatedly while waiting for the tasks to finish
182 self.checked = {} 187 self.checked = {}
183 for k in self.devDict: 188 for k in self.devDict:
@@ -219,8 +224,8 @@ class diskMonitor:
219 self.checked[k] = True 224 self.checked[k] = True
220 rq.finish_runqueue(False) 225 rq.finish_runqueue(False)
221 bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration) 226 bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration)
222 elif action == "ABORT" and not self.checked[k]: 227 elif action == "HALT" and not self.checked[k]:
223 logger.error("Immediately abort since the disk space monitor action is \"ABORT\"!") 228 logger.error("Immediately halt since the disk space monitor action is \"HALT\"!")
224 self.checked[k] = True 229 self.checked[k] = True
225 rq.finish_runqueue(True) 230 rq.finish_runqueue(True)
226 bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration) 231 bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration)
@@ -245,8 +250,8 @@ class diskMonitor:
245 self.checked[k] = True 250 self.checked[k] = True
246 rq.finish_runqueue(False) 251 rq.finish_runqueue(False)
247 bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration) 252 bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration)
248 elif action == "ABORT" and not self.checked[k]: 253 elif action == "HALT" and not self.checked[k]:
249 logger.error("Immediately abort since the disk space monitor action is \"ABORT\"!") 254 logger.error("Immediately halt since the disk space monitor action is \"HALT\"!")
250 self.checked[k] = True 255 self.checked[k] = True
251 rq.finish_runqueue(True) 256 rq.finish_runqueue(True)
252 bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration) 257 bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration)