summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bblayers/action.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-16 18:20:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-18 11:35:05 +0100
commit37c31a5adc26fc947a447ca9eae0983a654d1a33 (patch)
tree4d40adb741fd25fb0f60993e303ad5e9e7d5fa1a /bitbake/lib/bblayers/action.py
parentd1f84db670bd130353ebc5fb8077cf9657fb4e44 (diff)
downloadpoky-37c31a5adc26fc947a447ca9eae0983a654d1a33.tar.gz
bitbake: lib: Drop inotify support and replace with mtime checks
With the flush in serverlog() removed and a memory resident bitbake with a 60s timeout, the following could fail in strange ways: rm bitbake-cookerdaemon.log bitbake-layers add-layer ../meta-virtualization/ bitbake-layers add-layer ../meta-openembedded/meta-oe/ bitbake -m specifically that it might error adding meta-oe with an error related to meta-virt. This clearly shows that whilst bblayers.conf was modified, bitbake was not recognising that. This would fit with the random autobuilder issues seen when the serverlog flush() call was removed. The issue appears to be that you have no way to "sync()" the inotify events with the command stream coming over the socket. There is no way to know if there are changes in the IO queue which bitbake needs to wait for before proceeding with the next command. I did experiment with os.sync() and fsync on the inotify fd, however nothing addressed the issue. Since it is extremely important we have accurate cache data, the only realistic thing to do is to switch to stat() calls and check mtime. For bitbake commands, this is straightforward since we can revalidate the cache upon new connections/commands. For tinfoil this is problematic and we need to introduce and explict command "revalidateCaches" that the code can use to force bitbake to re-check it's cache validity. I've exposed this through tinfoil with a new "modified_files" function. So, this patch: a) drops inotify support within bitbake's cooker/server and switch to using mtime b) requires a new function call in tinfoil when metadata has been modified (Bitbake rev: da3ec3801bdb80180b3f1ac24edb27a698415ff7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bblayers/action.py')
-rw-r--r--bitbake/lib/bblayers/action.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py
index 0d7fd6edd1..a8f2699335 100644
--- a/bitbake/lib/bblayers/action.py
+++ b/bitbake/lib/bblayers/action.py
@@ -50,12 +50,14 @@ class ActionPlugin(LayerPlugin):
50 50
51 try: 51 try:
52 notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdirs, None) 52 notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdirs, None)
53 self.tinfoil.modified_files()
53 if not (args.force or notadded): 54 if not (args.force or notadded):
54 try: 55 try:
55 self.tinfoil.run_command('parseConfiguration') 56 self.tinfoil.run_command('parseConfiguration')
56 except (bb.tinfoil.TinfoilUIException, bb.BBHandledException): 57 except (bb.tinfoil.TinfoilUIException, bb.BBHandledException):
57 # Restore the back up copy of bblayers.conf 58 # Restore the back up copy of bblayers.conf
58 shutil.copy2(backup, bblayers_conf) 59 shutil.copy2(backup, bblayers_conf)
60 self.tinfoil.modified_files()
59 bb.fatal("Parse failure with the specified layer added, exiting.") 61 bb.fatal("Parse failure with the specified layer added, exiting.")
60 else: 62 else:
61 for item in notadded: 63 for item in notadded:
@@ -81,6 +83,7 @@ class ActionPlugin(LayerPlugin):
81 layerdir = os.path.abspath(item) 83 layerdir = os.path.abspath(item)
82 layerdirs.append(layerdir) 84 layerdirs.append(layerdir)
83 (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdirs) 85 (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdirs)
86 self.tinfoil.modified_files()
84 if notremoved: 87 if notremoved:
85 for item in notremoved: 88 for item in notremoved:
86 sys.stderr.write("No layers matching %s found in BBLAYERS\n" % item) 89 sys.stderr.write("No layers matching %s found in BBLAYERS\n" % item)
@@ -240,6 +243,9 @@ build results (as the layer priority order has effectively changed).
240 if not entry_found: 243 if not entry_found:
241 logger.warning("File %s does not match the flattened layer's BBFILES setting, you may need to edit conf/layer.conf or move the file elsewhere" % f1full) 244 logger.warning("File %s does not match the flattened layer's BBFILES setting, you may need to edit conf/layer.conf or move the file elsewhere" % f1full)
242 245
246 self.tinfoil.modified_files()
247
248
243 def get_file_layer(self, filename): 249 def get_file_layer(self, filename):
244 layerdir = self.get_file_layerdir(filename) 250 layerdir = self.get_file_layerdir(filename)
245 if layerdir: 251 if layerdir: