Skip to contentSkip to conversation

cooker/cache: Drop mc 'default' string value

PATCH New Richard Purdie 1 participant 1 message Jan 24, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cooker/cache: Drop mc 'default' string value

The string value "default" for the default multiconfig is confusing since an empty string is used pretty much everywhere in the code. Remove the few remaining references to that to standarise.

This affects the default value of BB_CURRENT_MC and does have an impact on metadata, particulalry bitbake.conf in openembedded-core. That said, the number of bugs we'll avoid by trying to make "default" back to "" within bitbake's code make fixing those extremely worthwhile.

---
 lib/bb/cache.py                                  | 2 +-
 lib/bb/cookerdata.py                             | 2 +-
 lib/bb/tests/runqueue-tests/classes/base.bbclass | 2 +-
 lib/bb/ui/uihelper.py                            | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
lib/bb/cache.py +1 -1
index ec7b023fc7..2361c5684d 100644
@@ -395,7 +395,7 @@ class Cache(object):
         # It will be used later for deciding whether we
         # need extra cache file dump/load support
         self.mc = mc
-        self.logger = PrefixLoggerAdapter("Cache: %s: " % (mc if mc else "default"), logger)
+        self.logger = PrefixLoggerAdapter("Cache: %s: " % (mc if mc else ''), logger)
         self.caches_array = caches_array
         self.cachedir = self.data.getVar("CACHE")
         self.clean = set()
lib/bb/cookerdata.py +1 -1
index 1f447d30c2..65c153a5bb 100644
@@ -346,7 +346,7 @@ class CookerDataBuilder(object):
     def _findLayerConf(self, data):
         return findConfigFile("bblayers.conf", data)
 
-    def parseConfigurationFiles(self, prefiles, postfiles, mc = "default"):
+    def parseConfigurationFiles(self, prefiles, postfiles, mc = ""):
         data = bb.data.createCopy(self.basedata)
         data.setVar("BB_CURRENT_MC", mc)
 
lib/bb/tests/runqueue-tests/classes/base.bbclass +1 -1
index b57650d591..80b003b2b5 100644
@@ -9,7 +9,7 @@ def stamptask(d):
     with open(stampname, "a+") as f:
         f.write(d.getVar("BB_UNIHASH") + "\n")
 
-    if d.getVar("BB_CURRENT_MC") != "default":
+    if d.getVar("BB_CURRENT_MC") != "":
         thistask = d.expand("${BB_CURRENT_MC}:${PN}:${BB_CURRENTTASK}")
     if thistask in d.getVar("SLOWTASKS").split():
         bb.note("Slowing task %s" % thistask)
lib/bb/ui/uihelper.py +1 -1
index 82913e0da8..e6983bd559 100644
@@ -31,7 +31,7 @@ class BBUIHelper:
 
         if isinstance(event, bb.build.TaskStarted):
             tid = event._fn + ":" + event._task
-            if event._mc != "default":
+            if event._mc != "":
                 self.running_tasks[tid] = { 'title' : "mc:%s:%s %s" % (event._mc, event._package, event._task), 'starttime' : time.time(), 'pid' : event.pid }
             else:
                 self.running_tasks[tid] = { 'title' : "%s %s" % (event._package, event._task), 'starttime' : time.time(), 'pid' : event.pid }