瀏覽代碼

bitbake: bitbake: Abort build if runtime dependency conflict

Currently if there are multiple preferred providers available for
a runtime dependency, bitbake will print an Error message and let
the build go on. Anyways the build should abort while any Errors
occured.

[YOCTO #2734]

(Bitbake rev: 5f81a714f4fca785780bef555b419f0250e5ec1c)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Wenzong Fan 13 年之前
父節點
當前提交
6a210e88b7
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 2 0
      bitbake/lib/bb/providers.py
  2. 2 1
      bitbake/lib/bb/taskdata.py

+ 2 - 0
bitbake/lib/bb/providers.py

@@ -35,6 +35,8 @@ class NoProvider(bb.BBHandledException):
 class NoRProvider(bb.BBHandledException):
     """Exception raised when no provider of a runtime dependency can be found"""
 
+class MultipleRProvider(bb.BBHandledException):
+    """Exception raised when multiple providers of a runtime dependency can be found"""
 
 def findProviders(cfgData, dataCache, pkg_pn = None):
     """

+ 2 - 1
bitbake/lib/bb/taskdata.py

@@ -482,6 +482,7 @@ class TaskData:
                     providers_list.append(dataCache.pkg_fn[fn])
                 bb.event.fire(bb.event.MultipleProviders(item, providers_list, runtime=True), cfgData)
             self.consider_msgs_cache.append(item)
+            raise bb.providers.MultipleRProvider(item)
 
         # run through the list until we find one that we can build
         for fn in eligible:
@@ -580,7 +581,7 @@ class TaskData:
                 try:
                     self.add_rprovider(cfgData, dataCache, target)
                     added = added + 1
-                except bb.providers.NoRProvider:
+                except (bb.providers.NoRProvider, bb.providers.MultipleRProvider):
                     self.remove_runtarget(self.getrun_id(target))
             logger.debug(1, "Resolved " + str(added) + " extra dependencies")
             if added == 0: