aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bblayers
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-13 20:07:06 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-14 09:54:48 +0000
commit3bbf8d611c859f74d563778115677a04f5c4ab43 (patch)
tree11a86283ca5e7026f90fdb685180605f9e19cea4 /lib/bblayers
parent74db369c46043116359101cab70486afd82372c0 (diff)
downloadbitbake-contrib-3bbf8d611c859f74d563778115677a04f5c4ab43.tar.gz
tinfoil: rewrite as a wrapper around the UI
Rewrite tinfoil as a wrapper around the UI, instead of the earlier approach of starting up just enough of cooker to do what we want. This has several advantages: * It now works when bitbake is memory-resident instead of failing with "ERROR: Only one copy of bitbake should be run against a build directory". * We can now connect an actual UI, thus you get things like the recipe parsing / cache loading progress bar and parse error handling for free * We can now handle events generated by the server if we wish to do so * We can potentially extend this to do more stuff, e.g. actually running build operations - this needs to be made more practical before we can use it though (since you effectively have to become the UI yourself for this at the moment.) The downside is that tinfoil no longer has direct access to cooker, the global datastore, or the cache. To mitigate this I have extended data_smart to provide remote access capability for the datastore, and created "fake" cooker and cooker.recipecache / cooker.collection adapter objects in order to avoid breaking too many tinfoil-using scripts that might be out there (we've never officially documented tinfoil or BitBake's internal code, but we can still make accommodations where practical). I've at least gone far enough to support all of the utilities that use tinfoil in OE-Core with some changes, but I know there are scripts such as Chris Larson's "bb" out there that do make other calls into BitBake code that I'm not currently providing access to through the adapters. Part of the fix for [YOCTO #5470]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bblayers')
-rw-r--r--lib/bblayers/query.py28
1 files changed, 6 insertions, 22 deletions
diff --git a/lib/bblayers/query.py b/lib/bblayers/query.py
index 29491163c..5def7179c 100644
--- a/lib/bblayers/query.py
+++ b/lib/bblayers/query.py
@@ -5,8 +5,6 @@ import sys
import os
import re
-import bb.cache
-import bb.providers
import bb.utils
from bblayers.common import LayerPlugin
@@ -122,15 +120,13 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
sys.exit(1)
pkg_pn = self.tinfoil.cooker.recipecaches[''].pkg_pn
- (latest_versions, preferred_versions) = bb.providers.findProviders(self.tinfoil.config_data, self.tinfoil.cooker.recipecaches[''], pkg_pn)
- allproviders = bb.providers.allProviders(self.tinfoil.cooker.recipecaches[''])
+ (latest_versions, preferred_versions) = self.tinfoil.find_providers()
+ allproviders = self.tinfoil.get_all_providers()
# Ensure we list skipped recipes
# We are largely guessing about PN, PV and the preferred version here,
# but we have no choice since skipped recipes are not fully parsed
skiplist = list(self.tinfoil.cooker.skiplist.keys())
- skiplist.sort( key=lambda fileitem: self.tinfoil.cooker.collection.calc_bbfile_priority(fileitem) )
- skiplist.reverse()
for fn in skiplist:
recipe_parts = os.path.splitext(os.path.basename(fn))[0].split('_')
p = recipe_parts[0]
@@ -265,10 +261,7 @@ Lists recipes with the bbappends that apply to them as subitems.
def show_appends_for_pn(self, pn):
filenames = self.tinfoil.cooker_data.pkg_pn[pn]
- best = bb.providers.findBestProvider(pn,
- self.tinfoil.config_data,
- self.tinfoil.cooker_data,
- self.tinfoil.cooker_data.pkg_pn)
+ best = self.tinfoil.find_best_provider(pn)
best_filename = os.path.basename(best[3])
return self.show_appends_output(filenames, best_filename)
@@ -336,10 +329,7 @@ NOTE: .bbappend files can impact the dependencies.
deps = self.tinfoil.cooker_data.deps[f]
for pn in deps:
if pn in self.tinfoil.cooker_data.pkg_pn:
- best = bb.providers.findBestProvider(pn,
- self.tinfoil.config_data,
- self.tinfoil.cooker_data,
- self.tinfoil.cooker_data.pkg_pn)
+ best = self.tinfoil.find_best_provider(pn)
self.check_cross_depends("DEPENDS", layername, f, best[3], args.filenames, ignore_layers)
# The RDPENDS
@@ -352,14 +342,11 @@ NOTE: .bbappend files can impact the dependencies.
sorted_rdeps[k2] = 1
all_rdeps = sorted_rdeps.keys()
for rdep in all_rdeps:
- all_p = bb.providers.getRuntimeProviders(self.tinfoil.cooker_data, rdep)
+ all_p, best = self.tinfoil.get_runtime_providers(rdep)
if all_p:
if f in all_p:
# The recipe provides this one itself, ignore
continue
- best = bb.providers.filterProvidersRunTime(all_p, rdep,
- self.tinfoil.config_data,
- self.tinfoil.cooker_data)[0][0]
self.check_cross_depends("RDEPENDS", layername, f, best, args.filenames, ignore_layers)
# The RRECOMMENDS
@@ -372,14 +359,11 @@ NOTE: .bbappend files can impact the dependencies.
sorted_rrecs[k2] = 1
all_rrecs = sorted_rrecs.keys()
for rrec in all_rrecs:
- all_p = bb.providers.getRuntimeProviders(self.tinfoil.cooker_data, rrec)
+ all_p, best = self.tinfoil.get_runtime_providers(rrec)
if all_p:
if f in all_p:
# The recipe provides this one itself, ignore
continue
- best = bb.providers.filterProvidersRunTime(all_p, rrec,
- self.tinfoil.config_data,
- self.tinfoil.cooker_data)[0][0]
self.check_cross_depends("RRECOMMENDS", layername, f, best, args.filenames, ignore_layers)
# The inherit class