diff mbox series

recipe_sanity: accept new renameVar() arguments in the monkey-patch

Message ID 20260820002213.2272711-1-dmitry.baryshkov@oss.qualcomm.com
State New
Headers show
Series recipe_sanity: accept new renameVar() arguments in the monkey-patch | expand

Commit Message

Dmitry Baryshkov Aug. 20, 2026, 12:22 a.m. UTC
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 <dmitry.baryshkov@oss.qualcomm.com>
---
 meta/classes/recipe_sanity.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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()