summaryrefslogtreecommitdiffstats
path: root/bitbake/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 12:25:07 +0000
commit7d5c9860de05efc4272256ccefc530113f01d24e (patch)
tree659eb51c50941c2920215512e38d59da9cb85ee5 /bitbake/lib/bblayers
parente271d7dc606185130e0e47327205bd423490b7c2 (diff)
downloadpoky-7d5c9860de05efc4272256ccefc530113f01d24e.tar.gz
bitbake: 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]. (Bitbake rev: 3bbf8d611c859f74d563778115677a04f5c4ab43) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bblayers')
-rw-r--r--bitbake/lib/bblayers/query.py28
1 files changed, 6 insertions, 22 deletions
diff --git a/bitbake/lib/bblayers/query.py b/bitbake/lib/bblayers/query.py
index 29491163c2..5def7179ce 100644
--- a/bitbake/lib/bblayers/query.py
+++ b/bitbake/lib/bblayers/query.py
@@ -5,8 +5,6 @@ import sys
5import os 5import os
6import re 6import re
7 7
8import bb.cache
9import bb.providers
10import bb.utils 8import bb.utils
11 9
12from bblayers.common import LayerPlugin 10from bblayers.common import LayerPlugin
@@ -122,15 +120,13 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
122 sys.exit(1) 120 sys.exit(1)
123 121
124 pkg_pn = self.tinfoil.cooker.recipecaches[''].pkg_pn 122 pkg_pn = self.tinfoil.cooker.recipecaches[''].pkg_pn
125 (latest_versions, preferred_versions) = bb.providers.findProviders(self.tinfoil.config_data, self.tinfoil.cooker.recipecaches[''], pkg_pn) 123 (latest_versions, preferred_versions) = self.tinfoil.find_providers()
126 allproviders = bb.providers.allProviders(self.tinfoil.cooker.recipecaches['']) 124 allproviders = self.tinfoil.get_all_providers()
127 125
128 # Ensure we list skipped recipes 126 # Ensure we list skipped recipes
129 # We are largely guessing about PN, PV and the preferred version here, 127 # We are largely guessing about PN, PV and the preferred version here,
130 # but we have no choice since skipped recipes are not fully parsed 128 # but we have no choice since skipped recipes are not fully parsed
131 skiplist = list(self.tinfoil.cooker.skiplist.keys()) 129 skiplist = list(self.tinfoil.cooker.skiplist.keys())
132 skiplist.sort( key=lambda fileitem: self.tinfoil.cooker.collection.calc_bbfile_priority(fileitem) )
133 skiplist.reverse()
134 for fn in skiplist: 130 for fn in skiplist:
135 recipe_parts = os.path.splitext(os.path.basename(fn))[0].split('_') 131 recipe_parts = os.path.splitext(os.path.basename(fn))[0].split('_')
136 p = recipe_parts[0] 132 p = recipe_parts[0]
@@ -265,10 +261,7 @@ Lists recipes with the bbappends that apply to them as subitems.
265 def show_appends_for_pn(self, pn): 261 def show_appends_for_pn(self, pn):
266 filenames = self.tinfoil.cooker_data.pkg_pn[pn] 262 filenames = self.tinfoil.cooker_data.pkg_pn[pn]
267 263
268 best = bb.providers.findBestProvider(pn, 264 best = self.tinfoil.find_best_provider(pn)
269 self.tinfoil.config_data,
270 self.tinfoil.cooker_data,
271 self.tinfoil.cooker_data.pkg_pn)
272 best_filename = os.path.basename(best[3]) 265 best_filename = os.path.basename(best[3])
273 266
274 return self.show_appends_output(filenames, best_filename) 267 return self.show_appends_output(filenames, best_filename)
@@ -336,10 +329,7 @@ NOTE: .bbappend files can impact the dependencies.
336 deps = self.tinfoil.cooker_data.deps[f] 329 deps = self.tinfoil.cooker_data.deps[f]
337 for pn in deps: 330 for pn in deps:
338 if pn in self.tinfoil.cooker_data.pkg_pn: 331 if pn in self.tinfoil.cooker_data.pkg_pn:
339 best = bb.providers.findBestProvider(pn, 332 best = self.tinfoil.find_best_provider(pn)
340 self.tinfoil.config_data,
341 self.tinfoil.cooker_data,
342 self.tinfoil.cooker_data.pkg_pn)
343 self.check_cross_depends("DEPENDS", layername, f, best[3], args.filenames, ignore_layers) 333 self.check_cross_depends("DEPENDS", layername, f, best[3], args.filenames, ignore_layers)
344 334
345 # The RDPENDS 335 # The RDPENDS
@@ -352,14 +342,11 @@ NOTE: .bbappend files can impact the dependencies.
352 sorted_rdeps[k2] = 1 342 sorted_rdeps[k2] = 1
353 all_rdeps = sorted_rdeps.keys() 343 all_rdeps = sorted_rdeps.keys()
354 for rdep in all_rdeps: 344 for rdep in all_rdeps:
355 all_p = bb.providers.getRuntimeProviders(self.tinfoil.cooker_data, rdep) 345 all_p, best = self.tinfoil.get_runtime_providers(rdep)
356 if all_p: 346 if all_p:
357 if f in all_p: 347 if f in all_p:
358 # The recipe provides this one itself, ignore 348 # The recipe provides this one itself, ignore
359 continue 349 continue
360 best = bb.providers.filterProvidersRunTime(all_p, rdep,
361 self.tinfoil.config_data,
362 self.tinfoil.cooker_data)[0][0]
363 self.check_cross_depends("RDEPENDS", layername, f, best, args.filenames, ignore_layers) 350 self.check_cross_depends("RDEPENDS", layername, f, best, args.filenames, ignore_layers)
364 351
365 # The RRECOMMENDS 352 # The RRECOMMENDS
@@ -372,14 +359,11 @@ NOTE: .bbappend files can impact the dependencies.
372 sorted_rrecs[k2] = 1 359 sorted_rrecs[k2] = 1
373 all_rrecs = sorted_rrecs.keys() 360 all_rrecs = sorted_rrecs.keys()
374 for rrec in all_rrecs: 361 for rrec in all_rrecs:
375 all_p = bb.providers.getRuntimeProviders(self.tinfoil.cooker_data, rrec) 362 all_p, best = self.tinfoil.get_runtime_providers(rrec)
376 if all_p: 363 if all_p:
377 if f in all_p: 364 if f in all_p:
378 # The recipe provides this one itself, ignore 365 # The recipe provides this one itself, ignore
379 continue 366 continue
380 best = bb.providers.filterProvidersRunTime(all_p, rrec,
381 self.tinfoil.config_data,
382 self.tinfoil.cooker_data)[0][0]
383 self.check_cross_depends("RRECOMMENDS", layername, f, best, args.filenames, ignore_layers) 367 self.check_cross_depends("RRECOMMENDS", layername, f, best, args.filenames, ignore_layers)
384 368
385 # The inherit class 369 # The inherit class