Any build inheriting recipe_sanity fails during base configuration
parsing with:

  TypeError: recipe_sanity_eh.<locals>.myrename() got an unexpected
  keyword argument 'recurse'

recipe_sanity_eh() replaces bb.data_smart.DataSmart.renameVar() with its
own wrapper in order to record variable renames. The wrapper hardcoded
the signature as (self, key, newkey), so it broke as soon as bitbake
grew a new parameter: renameVar() gained a 'recurse' argument and
bb.data.expandKeys() now passes recurse=False, which the wrapper cannot
accept. As expandKeys() is called while hashing the base datastore, this
kills the build before a single recipe is parsed.

Forward any extra positional and keyword arguments to the original
renameVar() instead of enumerating them, so the wrapper stays working
across future signature changes as well.

Fixes: a3c6a020da9a ("data: Fix expandKeys recursion issue")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Dmitry Baryshkov <[email protected]>
---
 meta/classes/recipe_sanity.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/recipe_sanity.bbclass 
b/meta/classes/recipe_sanity.bbclass
index a5cc4315fb86..cd35ed6a1302 100644
--- a/meta/classes/recipe_sanity.bbclass
+++ b/meta/classes/recipe_sanity.bbclass
@@ -141,9 +141,9 @@ python recipe_sanity_eh () {
     # Sick, very sick..
     from bb.data_smart import DataSmart
     old = DataSmart.renameVar
-    def myrename(self, key, newkey):
+    def myrename(self, key, newkey, *args, **kwargs):
         oldvalue = self.getVar(newkey, 0)
-        old(self, key, newkey)
+        old(self, key, newkey, *args, **kwargs)
         newvalue = self.getVar(newkey, 0)
         if oldvalue:
             renames = self.getVar("__recipe_sanity_renames", 0) or set()
-- 
2.47.3

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#243799): 
https://lists.openembedded.org/g/openembedded-core/message/243799
Mute This Topic: https://lists.openembedded.org/mt/120839376/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to