summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tinfoil.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/bb/tinfoil.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/bb/tinfoil.py')
-rw-r--r--bitbake/lib/bb/tinfoil.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py
index 91fbf1b13e..2200caa54c 100644
--- a/bitbake/lib/bb/tinfoil.py
+++ b/bitbake/lib/bb/tinfoil.py
@@ -449,6 +449,12 @@ class Tinfoil:
449 self.run_actions(config_params) 449 self.run_actions(config_params)
450 self.recipes_parsed = True 450 self.recipes_parsed = True
451 451
452 def modified_files(self):
453 """
454 Notify the server it needs to revalidate it's caches since the client has modified files
455 """
456 self.run_command("revalidateCaches")
457
452 def run_command(self, command, *params, handle_events=True): 458 def run_command(self, command, *params, handle_events=True):
453 """ 459 """
454 Run a command on the server (as implemented in bb.command). 460 Run a command on the server (as implemented in bb.command).