summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-30 18:29:57 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-01 23:14:01 +0100
commitfd1a6bad77b008af28291567aa53776c644c3a48 (patch)
treed8a95947841b8221d6e7cdb46d71e2ffe43f966f
parent3fdbeb0895a5dcc70fdfa22154cbead9b707323f (diff)
downloadpoky-fd1a6bad77b008af28291567aa53776c644c3a48.tar.gz
bitbake: cooker: Further fixes to inotify to fix memres bitbake issues
The previous fix for inotify wasn't quite correct as we need to modify bbseen before calling add_filewatch(). We also need to ensure the parse mtime cache is cleared when directories are added/removed. There was also a typo in the original fix and the wrong watcher was being changed. Fix the various issues which improves memory resident bitbake testing results. (Bitbake rev: 66cadd6be58bce5f7a56556cf92efd8159fb0b0e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/cooker.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index f435b18c87..1359d33f77 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -254,9 +254,14 @@ class BBCooker:
254 if not event.pathname in self.configwatcher.bbwatchedfiles: 254 if not event.pathname in self.configwatcher.bbwatchedfiles:
255 return 255 return
256 if "IN_ISDIR" in event.maskname: 256 if "IN_ISDIR" in event.maskname:
257 if "IN_CREATE" in event.maskname or "IN_DELETE" in event.maskname:
258 if event.pathname in self.configwatcher.bbseen:
259 self.configwatcher.bbseen.remove(event.pathname)
260 # Could remove all entries starting with the directory but for now...
261 bb.parse.clear_cache()
257 if "IN_CREATE" in event.maskname: 262 if "IN_CREATE" in event.maskname:
258 self.add_filewatch([[event.pathname]], watcher=self.configwatcher, dirs=True) 263 self.add_filewatch([[event.pathname]], watcher=self.configwatcher, dirs=True)
259 elif "IN_DELETE" in event.maskname and event.pathname in self.watcher.bbseen: 264 elif "IN_DELETE" in event.maskname and event.pathname in self.configwatcher.bbseen:
260 self.configwatcher.bbseen.remove(event.pathname) 265 self.configwatcher.bbseen.remove(event.pathname)
261 if not event.pathname in self.inotify_modified_files: 266 if not event.pathname in self.inotify_modified_files:
262 self.inotify_modified_files.append(event.pathname) 267 self.inotify_modified_files.append(event.pathname)
@@ -272,6 +277,11 @@ class BBCooker:
272 or event.pathname.endswith("bitbake.lock"): 277 or event.pathname.endswith("bitbake.lock"):
273 return 278 return
274 if "IN_ISDIR" in event.maskname: 279 if "IN_ISDIR" in event.maskname:
280 if "IN_CREATE" in event.maskname or "IN_DELETE" in event.maskname:
281 if event.pathname in self.watcher.bbseen:
282 self.watcher.bbseen.remove(event.pathname)
283 # Could remove all entries starting with the directory but for now...
284 bb.parse.clear_cache()
275 if "IN_CREATE" in event.maskname: 285 if "IN_CREATE" in event.maskname:
276 self.add_filewatch([[event.pathname]], dirs=True) 286 self.add_filewatch([[event.pathname]], dirs=True)
277 elif "IN_DELETE" in event.maskname and event.pathname in self.watcher.bbseen: 287 elif "IN_DELETE" in event.maskname and event.pathname in self.watcher.bbseen: