diff mbox series

[05/17] cooker/cache/command/tinfoil: Drop bbfile_priority

Message ID 20261130152847.3472849-5-richard.purdie@linuxfoundation.org
State New
Headers show
Series [01/17] uihelper: Fix exception when TaskStarted event handler breaks | expand

Commit Message

Richard Purdie Nov. 30, 2026, 3:28 p.m. UTC
These are confusing and about to be removed with the layer changes. Prepare the way
for that by removing the cached priority values.

Remove the command and tinfoil APIs that access it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/cache.py   |  1 -
 lib/bb/command.py | 18 +-----------------
 lib/bb/cooker.py  |  7 -------
 lib/bb/tinfoil.py | 10 ----------
 4 files changed, 1 insertion(+), 35 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index a1d8bfbd8dd..67c3f14ccc1 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -808,7 +808,6 @@  class CacheData(object):
         # Indirect Cache variables (set elsewhere)
         self.ignored_dependencies = []
         self.world_target = set()
-        self.bbfile_priority = {}
 
     def add_from_recipeinfo(self, fn, info_array):
         for info in info_array:
diff --git a/lib/bb/command.py b/lib/bb/command.py
index f49ebb19d8e..9848b7a6732 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -406,14 +406,6 @@  class CommandsSync:
         return command.cooker.recipecaches[mc].inherits
     getRecipeInherits.readonly = True
 
-    def getBbFilePriority(self, command, params):
-        try:
-            mc = params[0]
-        except IndexError:
-            mc = ''
-        return command.cooker.recipecaches[mc].bbfile_priority
-    getBbFilePriority.readonly = True
-
     def getDefaultPreference(self, command, params):
         try:
             mc = params[0]
@@ -437,15 +429,7 @@  class CommandsSync:
             mc = params[0]
         except IndexError:
             mc = ''
-
-        # Return list sorted by reverse priority order
-        import bb.cache
-        def sortkey(x):
-            vfn, _ = x
-            realfn, _, item_mc = bb.cache.virtualfn2realfn(vfn)
-            return -command.cooker.collections[item_mc].calc_bbfile_priority(realfn)[0], vfn
-
-        skipdict = OrderedDict(sorted(command.cooker.skiplist_by_mc[mc].items(), key=sortkey))
+        skipdict = OrderedDict(sorted(command.cooker.skiplist_by_mc[mc].items()))
         return list(skipdict.items())
     getSkippedRecipes.readonly = True
 
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 54f87278fde..7fca4ac2f74 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1421,7 +1421,6 @@  You can also remove the BB_HASHSERVE_UPSTREAM setting, but this may result in si
         # Tweak some variables
         item = info_array[0].pn
         self.recipecaches[mc].ignored_dependencies = set()
-        self.recipecaches[mc].bbfile_priority[fn] = 1
         self.configuration.limited_deps = True
 
         # Remove external dependencies
@@ -1702,8 +1701,6 @@  You can also remove the BB_HASHSERVE_UPSTREAM setting, but this may result in si
                 raise bb.BBHandledException()
             self.show_appends_with_no_recipes()
             self.handlePrefProviders()
-            for mc in self.multiconfigs:
-                self.recipecaches[mc].bbfile_priority = self.collections[mc].collection_priorities(self.recipecaches[mc].pkg_fn, self.parser.mcfilelist[mc], self.data)
             self.state = State.RUNNING
 
             # Send an event listing all stamps reachable after parsing
@@ -1875,10 +1872,6 @@  class CookerCollectFiles(object):
 
         files = (config.getVar( "BBFILES") or "").split()
 
-        # Sort files by priority
-        files.sort( key=lambda fileitem: self.calc_bbfile_priority(fileitem)[0] )
-        config.setVar("BBFILES_PRIORITIZED", " ".join(files))
-
         if not files:
             files = self.get_bbfiles()
 
diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index 4fd2a9af82e..e37cf88ef37 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -12,7 +12,6 @@  import os
 import sys
 import time
 import atexit
-import re
 from collections import OrderedDict, defaultdict
 from functools import partial, wraps
 from contextlib import contextmanager
@@ -300,8 +299,6 @@  class TinfoilCookerAdapter:
                 attrvalue = self.tinfoil.run_command('getRecipeVersions', self.mc) or {}
             elif name == 'inherits':
                 attrvalue = self.tinfoil.run_command('getRecipeInherits', self.mc) or {}
-            elif name == 'bbfile_priority':
-                attrvalue = self.tinfoil.run_command('getBbFilePriority', self.mc) or {}
             elif name == 'pkg_dp':
                 attrvalue = self.tinfoil.run_command('getDefaultPreference', self.mc) or {}
             elif name == 'fn_provides':
@@ -339,13 +336,6 @@  class TinfoilCookerAdapter:
         # Grab these only when they are requested since they aren't always used
         if name in self._cache:
             return self._cache[name]
-        elif name == 'bbfile_config_priorities':
-            ret = self.tinfoil.run_command('getLayerPriorities')
-            bbfile_config_priorities = []
-            for collection, pattern, regex, pri in ret:
-                bbfile_config_priorities.append((collection, pattern, re.compile(regex), pri))
-
-            attrvalue = bbfile_config_priorities
         else:
             raise AttributeError("%s instance has no attribute '%s'" % (self.__class__.__name__, name))