Skip to contentSkip to conversation

[1.46][PATCH] data_smart: Ensure hash reflects vardepvalue flags correctly

bitbake Steve Sakoman 1 participant 1 message Jan 25, 2021 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

From: Richard Purdie <[email protected]>

The get_hash() function is used to decide if the base configuration has changed and hence whether a reparse is required. The vardepvalue flag's value was not expanded but it is often used in contexts like:

METADATA_REVISION = "${@base_detect_revision(d)}" METADATA_REVISION[vardepvalue] = "${METADATA_REVISION}"

which in it's unexpanded form means reparsing doesn't happen when it should as the data appears unchanged. Update get_hash to expand the values of vardepvalue so reparsing works as expected. This avoids basehash mismatch errors such as the one recently caused by using METADATA_REVISION in poky.conf's DISTRO_VERSION variable. The issue there could be exposed by a recipe using DISTRO_VERSION with the sequence:

bitbake os-release
<change the revision of the metadata with a dummy commit> bitbake os-release -C install

which was caused because METADATA_REVISION changed but the metadata didn't reparse.

(cherry picked from commit 26ccf1575aef2d6e2d7717d3bd10b1ed0d5a777d)
---
 lib/bb/data_smart.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/data_smart.py +1 -1
index 7f1b6dcb..1d8774ee 100644
@@ -1005,7 +1005,7 @@ class DataSmart(MutableMapping):
             else:
                 data.update({key:value})
 
-            varflags = d.getVarFlags(key, internalflags = True)
+            varflags = d.getVarFlags(key, internalflags = True, expand=["vardepvalue"])
             if not varflags:
                 continue
             for f in varflags:
Signature · 1 line
2.25.1