summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/command.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2020-06-05 22:15:29 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-10 12:30:01 +0100
commitb9fdb6a4261754459a01f9689010a38922fe0c8a (patch)
treef06ef9f8d1ad7ffa27f64e501228f4d312bdbc94 /bitbake/lib/bb/command.py
parentf08d269c484417f3284c683ed690584642d33915 (diff)
downloadpoky-b9fdb6a4261754459a01f9689010a38922fe0c8a.tar.gz
bitbake: bitbake: cooker: Split file collections per multiconfig
Splits the cooker to track a collection per multiconfig instead of a single collection for all multiconfigs. Practically speaking, this allows each multiconfigs to each have different BBMASKs that apply to it instead of each one using the mask specified in the base configuration. (Bitbake rev: dd6d8eca2027f8d9be8a734a493227b440075e49) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/command.py')
-rw-r--r--bitbake/lib/bb/command.py37
1 files changed, 29 insertions, 8 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 6abf38668b..d11907e3ba 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -232,7 +232,11 @@ class CommandsSync:
232 232
233 def matchFile(self, command, params): 233 def matchFile(self, command, params):
234 fMatch = params[0] 234 fMatch = params[0]
235 return command.cooker.matchFile(fMatch) 235 try:
236 mc = params[0]
237 except IndexError:
238 mc = ''
239 return command.cooker.matchFile(fMatch, mc)
236 matchFile.needconfig = False 240 matchFile.needconfig = False
237 241
238 def getUIHandlerNum(self, command, params): 242 def getUIHandlerNum(self, command, params):
@@ -395,22 +399,38 @@ class CommandsSync:
395 def getSkippedRecipes(self, command, params): 399 def getSkippedRecipes(self, command, params):
396 # Return list sorted by reverse priority order 400 # Return list sorted by reverse priority order
397 import bb.cache 401 import bb.cache
398 skipdict = OrderedDict(sorted(command.cooker.skiplist.items(), 402 def sortkey(x):
399 key=lambda x: (-command.cooker.collection.calc_bbfile_priority(bb.cache.virtualfn2realfn(x[0])[0]), x[0]))) 403 vfn, _ = x
404 realfn, _, mc = bb.cache.virtualfn2realfn(vfn)
405 return (-command.cooker.collections[mc].calc_bbfile_priority(realfn), vfn)
406
407 skipdict = OrderedDict(sorted(command.cooker.skiplist.items(), key=sortkey))
400 return list(skipdict.items()) 408 return list(skipdict.items())
401 getSkippedRecipes.readonly = True 409 getSkippedRecipes.readonly = True
402 410
403 def getOverlayedRecipes(self, command, params): 411 def getOverlayedRecipes(self, command, params):
404 return list(command.cooker.collection.overlayed.items()) 412 try:
413 mc = params[0]
414 except IndexError:
415 mc = ''
416 return list(command.cooker.collections[mc].overlayed.items())
405 getOverlayedRecipes.readonly = True 417 getOverlayedRecipes.readonly = True
406 418
407 def getFileAppends(self, command, params): 419 def getFileAppends(self, command, params):
408 fn = params[0] 420 fn = params[0]
409 return command.cooker.collection.get_file_appends(fn) 421 try:
422 mc = params[1]
423 except IndexError:
424 mc = ''
425 return command.cooker.collections[mc].get_file_appends(fn)
410 getFileAppends.readonly = True 426 getFileAppends.readonly = True
411 427
412 def getAllAppends(self, command, params): 428 def getAllAppends(self, command, params):
413 return command.cooker.collection.bbappends 429 try:
430 mc = params[0]
431 except IndexError:
432 mc = ''
433 return command.cooker.collections[mc].bbappends
414 getAllAppends.readonly = True 434 getAllAppends.readonly = True
415 435
416 def findProviders(self, command, params): 436 def findProviders(self, command, params):
@@ -496,6 +516,7 @@ class CommandsSync:
496 for the recipe. 516 for the recipe.
497 """ 517 """
498 fn = params[0] 518 fn = params[0]
519 mc = bb.runqueue.mc_from_tid(fn)
499 appends = params[1] 520 appends = params[1]
500 appendlist = params[2] 521 appendlist = params[2]
501 if len(params) > 3: 522 if len(params) > 3:
@@ -507,7 +528,7 @@ class CommandsSync:
507 if appendlist is not None: 528 if appendlist is not None:
508 appendfiles = appendlist 529 appendfiles = appendlist
509 else: 530 else:
510 appendfiles = command.cooker.collection.get_file_appends(fn) 531 appendfiles = command.cooker.collections[mc].get_file_appends(fn)
511 else: 532 else:
512 appendfiles = [] 533 appendfiles = []
513 # We are calling bb.cache locally here rather than on the server, 534 # We are calling bb.cache locally here rather than on the server,
@@ -517,7 +538,7 @@ class CommandsSync:
517 if config_data: 538 if config_data:
518 # We have to use a different function here if we're passing in a datastore 539 # We have to use a different function here if we're passing in a datastore
519 # NOTE: we took a copy above, so we don't do it here again 540 # NOTE: we took a copy above, so we don't do it here again
520 envdata = bb.cache.parse_recipe(config_data, fn, appendfiles)[''] 541 envdata = bb.cache.parse_recipe(config_data, fn, appendfiles, mc)['']
521 else: 542 else:
522 # Use the standard path 543 # Use the standard path
523 parser = bb.cache.NoCache(command.cooker.databuilder) 544 parser = bb.cache.NoCache(command.cooker.databuilder)