diff mbox series

data_smart: Ensure module dependency changes invalidate the base config cache

Message ID 20250313133128.3345603-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit a121db3d8d28420c36369237b8bb11c2d0aaf5f7
Headers show
Series data_smart: Ensure module dependency changes invalidate the base config cache | expand

Commit Message

Richard Purdie March 13, 2025, 1:31 p.m. UTC
Changing module files was changing the tash hashes but it was not invalidating
the parse cache, leading to tashhash mismatch errors during builds.

Add information from modulecode_deps to the configuration hash used for
cache invalidation to avoid this and trigger reparses when function library
code changes.

[YOCTO #15795]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/data_smart.py | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 360068fd0a..8e7dd98384 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -1120,5 +1120,10 @@  class DataSmart(MutableMapping):
                     value = d.getVar(i, False) or ""
                     data.update({i:value})
 
+        moddeps = bb.codeparser.modulecode_deps
+        for dep in sorted(moddeps):
+            # Ignore visitor code, sort sets
+            data.update({'moddep[%s]' % dep : [sorted(moddeps[dep][0]), sorted(moddeps[dep][1]), sorted(moddeps[dep][2]), sorted(moddeps[dep][3]), moddeps[dep][4]]})
+
         data_str = str([(k, data[k]) for k in sorted(data.keys())])
         return hashlib.sha256(data_str.encode("utf-8")).hexdigest()