summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-08 13:20:35 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:35 +0100
commit7e53a3b5cff3599753d0729a488eb393b341da32 (patch)
tree8f77550046494afbb59afe8384e6d9b61d229fed /bitbake
parent75d49840cf1e7df9625f3c6d8bfb400599b66f84 (diff)
downloadpoky-7e53a3b5cff3599753d0729a488eb393b341da32.tar.gz
Move the output of no provider and multiple provider messages into the UI
(Bitbake rev: 36b980c16bf74b3c2066cc120f9f27e11f189a63) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/event.py3
-rw-r--r--bitbake/lib/bb/taskdata.py37
-rw-r--r--bitbake/lib/bb/ui/knotty.py20
3 files changed, 28 insertions, 32 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index c0a8db15aa..7731649eff 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -235,10 +235,11 @@ class BuildCompleted(BuildBase):
235class NoProvider(Event): 235class NoProvider(Event):
236 """No Provider for an Event""" 236 """No Provider for an Event"""
237 237
238 def __init__(self, item, runtime=False): 238 def __init__(self, item, runtime=False, dependees=None):
239 Event.__init__(self) 239 Event.__init__(self)
240 self._item = item 240 self._item = item
241 self._runtime = runtime 241 self._runtime = runtime
242 self._dependees = dependees
242 243
243 def getItem(self): 244 def getItem(self):
244 return self._item 245 return self._item
diff --git a/bitbake/lib/bb/taskdata.py b/bitbake/lib/bb/taskdata.py
index d4fd1498b6..e31f967850 100644
--- a/bitbake/lib/bb/taskdata.py
+++ b/bitbake/lib/bb/taskdata.py
@@ -354,13 +354,8 @@ class TaskData:
354 self.add_provider_internal(cfgData, dataCache, item) 354 self.add_provider_internal(cfgData, dataCache, item)
355 except bb.providers.NoProvider: 355 except bb.providers.NoProvider:
356 if self.abort: 356 if self.abort:
357 if self.get_rdependees_str(item):
358 bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (item, self.get_dependees_str(item)))
359 else:
360 bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s'" % (item))
361 raise 357 raise
362 targetid = self.getbuild_id(item) 358 self.remove_buildtarget(self.getbuild_id(item))
363 self.remove_buildtarget(targetid)
364 359
365 self.mark_external_target(item) 360 self.mark_external_target(item)
366 361
@@ -375,11 +370,7 @@ class TaskData:
375 return 370 return
376 371
377 if not item in dataCache.providers: 372 if not item in dataCache.providers:
378 if self.get_rdependees_str(item): 373 bb.event.fire(bb.event.NoProvider(item, dependees=self.get_rdependees_str(item)), cfgData)
379 bb.msg.note(2, bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (item, self.get_dependees_str(item)))
380 else:
381 bb.msg.note(2, bb.msg.domain.Provider, "Nothing PROVIDES '%s'" % (item))
382 bb.event.fire(bb.event.NoProvider(item), cfgData)
383 raise bb.providers.NoProvider(item) 374 raise bb.providers.NoProvider(item)
384 375
385 if self.have_build_target(item): 376 if self.have_build_target(item):
@@ -391,8 +382,7 @@ class TaskData:
391 eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids] 382 eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
392 383
393 if not eligible: 384 if not eligible:
394 bb.msg.note(2, bb.msg.domain.Provider, "No buildable provider PROVIDES '%s' but '%s' DEPENDS on or otherwise requires it. Enable debugging and see earlier logs to find unbuildable providers." % (item, self.get_dependees_str(item))) 385 bb.event.fire(bb.event.NoProvider(item, dependees=self.get_dependees_str(item)), cfgData)
395 bb.event.fire(bb.event.NoProvider(item), cfgData)
396 raise bb.providers.NoProvider(item) 386 raise bb.providers.NoProvider(item)
397 387
398 if len(eligible) > 1 and foundUnique == False: 388 if len(eligible) > 1 and foundUnique == False:
@@ -400,8 +390,6 @@ class TaskData:
400 providers_list = [] 390 providers_list = []
401 for fn in eligible: 391 for fn in eligible:
402 providers_list.append(dataCache.pkg_fn[fn]) 392 providers_list.append(dataCache.pkg_fn[fn])
403 bb.msg.note(1, bb.msg.domain.Provider, "multiple providers are available for %s (%s);" % (item, ", ".join(providers_list)))
404 bb.msg.note(1, bb.msg.domain.Provider, "consider defining PREFERRED_PROVIDER_%s" % item)
405 bb.event.fire(bb.event.MultipleProviders(item, providers_list), cfgData) 393 bb.event.fire(bb.event.MultipleProviders(item, providers_list), cfgData)
406 self.consider_msgs_cache.append(item) 394 self.consider_msgs_cache.append(item)
407 395
@@ -431,16 +419,14 @@ class TaskData:
431 all_p = bb.providers.getRuntimeProviders(dataCache, item) 419 all_p = bb.providers.getRuntimeProviders(dataCache, item)
432 420
433 if not all_p: 421 if not all_p:
434 bb.msg.error(bb.msg.domain.Provider, "'%s' RDEPENDS/RRECOMMENDS or otherwise requires the runtime entity '%s' but it wasn't found in any PACKAGE or RPROVIDES variables" % (self.get_rdependees_str(item), item)) 422 bb.event.fire(bb.event.NoProvider(item, runtime=True, dependees=self.get_rdependees_str(item)), cfgData)
435 bb.event.fire(bb.event.NoProvider(item, runtime=True), cfgData)
436 raise bb.providers.NoRProvider(item) 423 raise bb.providers.NoRProvider(item)
437 424
438 eligible, numberPreferred = bb.providers.filterProvidersRunTime(all_p, item, cfgData, dataCache) 425 eligible, numberPreferred = bb.providers.filterProvidersRunTime(all_p, item, cfgData, dataCache)
439 eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids] 426 eligible = [p for p in eligible if not self.getfn_id(p) in self.failed_fnids]
440 427
441 if not eligible: 428 if not eligible:
442 bb.msg.error(bb.msg.domain.Provider, "'%s' RDEPENDS/RRECOMMENDS or otherwise requires the runtime entity '%s' but it wasn't found in any PACKAGE or RPROVIDES variables of any buildable targets.\nEnable debugging and see earlier logs to find unbuildable targets." % (self.get_rdependees_str(item), item)) 429 bb.event.fire(bb.event.NoProvider(item, runtime=True, dependees=self.get_rdependees_str(item)), cfgData)
443 bb.event.fire(bb.event.NoProvider(item, runtime=True), cfgData)
444 raise bb.providers.NoRProvider(item) 430 raise bb.providers.NoRProvider(item)
445 431
446 if len(eligible) > 1 and numberPreferred == 0: 432 if len(eligible) > 1 and numberPreferred == 0:
@@ -448,8 +434,6 @@ class TaskData:
448 providers_list = [] 434 providers_list = []
449 for fn in eligible: 435 for fn in eligible:
450 providers_list.append(dataCache.pkg_fn[fn]) 436 providers_list.append(dataCache.pkg_fn[fn])
451 bb.msg.note(2, bb.msg.domain.Provider, "multiple providers are available for runtime %s (%s);" % (item, ", ".join(providers_list)))
452 bb.msg.note(2, bb.msg.domain.Provider, "consider defining a PREFERRED_PROVIDER entry to match runtime %s" % item)
453 bb.event.fire(bb.event.MultipleProviders(item, providers_list, runtime=True), cfgData) 437 bb.event.fire(bb.event.MultipleProviders(item, providers_list, runtime=True), cfgData)
454 self.consider_msgs_cache.append(item) 438 self.consider_msgs_cache.append(item)
455 439
@@ -458,8 +442,6 @@ class TaskData:
458 providers_list = [] 442 providers_list = []
459 for fn in eligible: 443 for fn in eligible:
460 providers_list.append(dataCache.pkg_fn[fn]) 444 providers_list.append(dataCache.pkg_fn[fn])
461 bb.msg.note(2, bb.msg.domain.Provider, "multiple providers are available for runtime %s (top %s entries preferred) (%s);" % (item, numberPreferred, ", ".join(providers_list)))
462 bb.msg.note(2, bb.msg.domain.Provider, "consider defining only one PREFERRED_PROVIDER entry to match runtime %s" % item)
463 bb.event.fire(bb.event.MultipleProviders(item, providers_list, runtime=True), cfgData) 445 bb.event.fire(bb.event.MultipleProviders(item, providers_list, runtime=True), cfgData)
464 self.consider_msgs_cache.append(item) 446 self.consider_msgs_cache.append(item)
465 447
@@ -515,8 +497,9 @@ class TaskData:
515 self.fail_fnid(self.tasks_fnid[taskid], missing_list) 497 self.fail_fnid(self.tasks_fnid[taskid], missing_list)
516 498
517 if self.abort and targetid in self.external_targets: 499 if self.abort and targetid in self.external_targets:
518 bb.msg.error(bb.msg.domain.Provider, "Required build target '%s' has no buildable providers.\nMissing or unbuildable dependency chain was: %s" % (self.build_names_index[targetid], missing_list)) 500 target = self.build_names_index[targetid]
519 raise bb.providers.NoProvider 501 bb.msg.error(bb.msg.domain.Provider, "Required build target '%s' has no buildable providers.\nMissing or unbuildable dependency chain was: %s" % (target, missing_list))
502 raise bb.providers.NoProvider(target)
520 503
521 def remove_runtarget(self, targetid, missing_list = []): 504 def remove_runtarget(self, targetid, missing_list = []):
522 """ 505 """
@@ -548,10 +531,6 @@ class TaskData:
548 except bb.providers.NoProvider: 531 except bb.providers.NoProvider:
549 targetid = self.getbuild_id(target) 532 targetid = self.getbuild_id(target)
550 if self.abort and targetid in self.external_targets: 533 if self.abort and targetid in self.external_targets:
551 if self.get_rdependees_str(target):
552 bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (target, self.get_dependees_str(target)))
553 else:
554 bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s'" % (target))
555 raise 534 raise
556 self.remove_buildtarget(targetid) 535 self.remove_buildtarget(targetid)
557 for target in self.get_unresolved_run_targets(dataCache): 536 for target in self.get_unresolved_run_targets(dataCache):
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index a7611a91a5..828e9d235a 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -147,17 +147,33 @@ def init(server, eventHandler):
147 break 147 break
148 if isinstance(event, bb.cooker.CookerExit): 148 if isinstance(event, bb.cooker.CookerExit):
149 break 149 break
150 if isinstance(event, bb.event.MultipleProviders):
151 print("NOTE: multiple providers are available for %s%s (%s)" % (event._is_runtime and "runtime " or "",
152 event._item,
153 ", ".join(event._candidates)))
154 print("NOTE: consider defining a PREFERRED_PROVIDER entry to match %s" % event._item)
155 continue
156 if isinstance(event, bb.event.NoProvider):
157 if event._runtime:
158 r = "R"
159 else:
160 r = ""
161
162 if event._dependees:
163 print("ERROR: Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)" % (r, event._item, ", ".join(event._dependees), r))
164 else:
165 print("ERROR: Nothing %sPROVIDES '%s'" % (r, event._item))
166 continue
150 167
151 # ignore 168 # ignore
152 if isinstance(event, (bb.event.BuildBase, 169 if isinstance(event, (bb.event.BuildBase,
153 bb.event.NoProvider,
154 bb.event.MultipleProviders,
155 bb.event.StampUpdate, 170 bb.event.StampUpdate,
156 bb.event.ConfigParsed, 171 bb.event.ConfigParsed,
157 bb.event.RecipeParsed, 172 bb.event.RecipeParsed,
158 bb.runqueue.runQueueEvent, 173 bb.runqueue.runQueueEvent,
159 bb.runqueue.runQueueExitWait)): 174 bb.runqueue.runQueueExitWait)):
160 continue 175 continue
176
161 print("Unknown Event: %s" % event) 177 print("Unknown Event: %s" % event)
162 178
163 except KeyboardInterrupt: 179 except KeyboardInterrupt: