summaryrefslogtreecommitdiff
path: root/poky/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
Diffstat (limited to 'poky/bitbake/lib/bb/cooker.py')
-rw-r--r--poky/bitbake/lib/bb/cooker.py61
1 files changed, 40 insertions, 21 deletions
diff --git a/poky/bitbake/lib/bb/cooker.py b/poky/bitbake/lib/bb/cooker.py
index c8e14042d..0008c2fde 100644
--- a/poky/bitbake/lib/bb/cooker.py
+++ b/poky/bitbake/lib/bb/cooker.py
@@ -378,8 +378,9 @@ class BBCooker:
if CookerFeatures.BASEDATASTORE_TRACKING in self.featureset:
self.disableDataTracking()
- self.data.renameVar("__depends", "__base_depends")
- self.add_filewatch(self.data.getVar("__base_depends", False), self.configwatcher)
+ for mc in self.databuilder.mcdata.values():
+ mc.renameVar("__depends", "__base_depends")
+ self.add_filewatch(mc.getVar("__base_depends", False), self.configwatcher)
self.baseconfig_valid = True
self.parsecache_valid = False
@@ -494,6 +495,7 @@ class BBCooker:
"""
fn = None
envdata = None
+ mc = ''
if not pkgs_to_build:
pkgs_to_build = []
@@ -502,6 +504,12 @@ class BBCooker:
self.enableDataTracking()
self.reset()
+ def mc_base(p):
+ if p.startswith('mc:'):
+ s = p.split(':')
+ if len(s) == 2:
+ return s[1]
+ return None
if buildfile:
# Parse the configuration here. We need to do it explicitly here since
@@ -512,18 +520,16 @@ class BBCooker:
fn = self.matchFile(fn)
fn = bb.cache.realfn2virtual(fn, cls, mc)
elif len(pkgs_to_build) == 1:
- ignore = self.data.getVar("ASSUME_PROVIDED") or ""
- if pkgs_to_build[0] in set(ignore.split()):
- bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0])
+ mc = mc_base(pkgs_to_build[0])
+ if not mc:
+ ignore = self.data.getVar("ASSUME_PROVIDED") or ""
+ if pkgs_to_build[0] in set(ignore.split()):
+ bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0])
- taskdata, runlist = self.buildTaskData(pkgs_to_build, None, self.configuration.abort, allowincomplete=True)
+ taskdata, runlist = self.buildTaskData(pkgs_to_build, None, self.configuration.abort, allowincomplete=True)
- mc = runlist[0][0]
- fn = runlist[0][3]
- else:
- envdata = self.data
- data.expandKeys(envdata)
- parse.ast.runAnonFuncs(envdata)
+ mc = runlist[0][0]
+ fn = runlist[0][3]
if fn:
try:
@@ -532,6 +538,12 @@ class BBCooker:
except Exception as e:
parselog.exception("Unable to read %s", fn)
raise
+ else:
+ if not mc in self.databuilder.mcdata:
+ bb.fatal('Not multiconfig named "%s" found' % mc)
+ envdata = self.databuilder.mcdata[mc]
+ data.expandKeys(envdata)
+ parse.ast.runAnonFuncs(envdata)
# Display history
with closing(StringIO()) as env:
@@ -571,10 +583,10 @@ class BBCooker:
wildcard = False
# Wild card expansion:
- # Replace string such as "multiconfig:*:bash"
- # into "multiconfig:A:bash multiconfig:B:bash bash"
+ # Replace string such as "mc:*:bash"
+ # into "mc:A:bash mc:B:bash bash"
for k in targetlist:
- if k.startswith("multiconfig:"):
+ if k.startswith("mc:"):
if wildcard:
bb.fatal('multiconfig conflict')
if k.split(":")[1] == "*":
@@ -607,7 +619,7 @@ class BBCooker:
runlist = []
for k in fulltargetlist:
mc = ""
- if k.startswith("multiconfig:"):
+ if k.startswith("mc:"):
mc = k.split(":")[1]
k = ":".join(k.split(":")[2:])
ktask = task
@@ -626,9 +638,13 @@ class BBCooker:
runlist.append([mc, k, ktask, fn])
bb.event.fire(bb.event.TreeDataPreparationProgress(current, len(fulltargetlist)), self.data)
+ havemc = False
+ for mc in self.multiconfigs:
+ if taskdata[mc].get_mcdepends():
+ havemc = True
# No need to do check providers if there are no mcdeps or not an mc build
- if len(self.multiconfigs) > 1:
+ if havemc or len(self.multiconfigs) > 1:
seen = set()
new = True
# Make sure we can provide the multiconfig dependency
@@ -688,7 +704,7 @@ class BBCooker:
@staticmethod
def add_mc_prefix(mc, pn):
if mc:
- return "multiconfig:%s:%s" % (mc, pn)
+ return "mc:%s:%s" % (mc, pn)
return pn
def buildDependTree(self, rq, taskdata):
@@ -1465,7 +1481,7 @@ class BBCooker:
ntargets = []
for target in runlist:
if target[0]:
- ntargets.append("multiconfig:%s:%s:%s" % (target[0], target[1], target[2]))
+ ntargets.append("mc:%s:%s:%s" % (target[0], target[1], target[2]))
ntargets.append("%s:%s" % (target[1], target[2]))
for mc in self.multiconfigs:
@@ -1588,6 +1604,9 @@ class BBCooker:
for pkg in pkgs_to_build:
if pkg in ignore:
parselog.warning("Explicit target \"%s\" is in ASSUME_PROVIDED, ignoring" % pkg)
+ if pkg.startswith("multiconfig:"):
+ pkgs_to_build.remove(pkg)
+ pkgs_to_build.append(pkg.replace("multiconfig:", "mc:"))
if 'world' in pkgs_to_build:
pkgs_to_build.remove('world')
@@ -1595,7 +1614,7 @@ class BBCooker:
bb.providers.buildWorldTargetList(self.recipecaches[mc], task)
for t in self.recipecaches[mc].world_target:
if mc:
- t = "multiconfig:" + mc + ":" + t
+ t = "mc:" + mc + ":" + t
pkgs_to_build.append(t)
if 'universe' in pkgs_to_build:
@@ -1614,7 +1633,7 @@ class BBCooker:
bb.debug(1, "Skipping %s for universe tasks as task %s doesn't exist" % (t, task))
continue
if mc:
- t = "multiconfig:" + mc + ":" + t
+ t = "mc:" + mc + ":" + t
pkgs_to_build.append(t)
return pkgs_to_build