<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>5044</bug_id>
          
          <creation_ts>2013-08-23 14:20:50 +0000</creation_ts>
          <short_desc>bitbake does not take into consideration some forms of PREFERRED_PROVIDERS</short_desc>
          <delta_ts>2016-04-15 06:07:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Cristian Iorga">cristian.iorga</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>daro</cc>
    
    <cc>jatedev</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>35888</commentid>
    <comment_count>0</comment_count>
    <who name="Cristian Iorga">cristian.iorga</who>
    <bug_when>2013-08-23 14:20:50 +0000</bug_when>
    <thetext>After the introduction of bluez5 recipe,
the following warnings are displayed:

&quot;NOTE: multiple providers are available for runtime libasound-module-bluez (bluez4, bluez5)
 NOTE: consider defining a PREFERRED_PROVIDER entry to match libasound-module-bluez&quot;

Upon debug, bitbake shows:
DEBUG: checking PREFERRED_PROVIDER_bluez4 (value None) against [&apos;bluez4&apos;, &apos;bluez5&apos;]
DEBUG: checking PREFERRED_PROVIDER_bluez4-4.101 (value None) against [&apos;bluez4&apos;, &apos;bluez5&apos;]
DEBUG: checking PREFERRED_PROVIDER_bluez4-4.101-r5 (value None) against [&apos;bluez4&apos;, &apos;bluez5&apos;]
DEBUG: checking PREFERRED_PROVIDER_bluez5 (value None) against [&apos;bluez4&apos;, &apos;bluez5&apos;]
DEBUG: checking PREFERRED_PROVIDER_bluez5-5.7 (value None) against [&apos;bluez4&apos;, &apos;bluez5&apos;]
DEBUG: checking PREFERRED_PROVIDER_bluez5-5.7-r0 (value None) against [&apos;bluez4&apos;, &apos;bluez5&apos;]

Now the right fix at this point would look at least like this
(added in meta/conf/distro/include/default-providers.inc):
PREFERRED_PROVIDER_libasound-module-bluez ?= &quot;bluez4&quot;

Instead, it looks rather puzzling:
PREFERRED_PROVIDER_bluez4 ?= &quot;bluez4&quot;

Explanation:
Bitbake is faced with &quot;what should provide libasound-module-bluez&quot;
which is a runtime name. It needs to try and find a PREFERRED_PROVIDER
entry which matches this but those use *build time* naming.
So it converts &quot;libasound-module-bluez&quot; into
the canonical ${PN} of bluez4 and bluez5 and then
tries to look those up.
What it actually should do is go one step further
of mapping bluez4/bluex5 into the virtual/bluez
But that does not happen;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50874</commentid>
    <comment_count>1</comment_count>
    <who name="Jate Sujjavanich">jatedev</who>
    <bug_when>2015-05-07 23:51:16 +0000</bug_when>
    <thetext>I came across these bugs in poky 1.6.3 (daisy) with multiple package providers. I fixed bug 6149 with just bitbake patch.

I came across another bug with this when I tried the bitbake fix on master. With the test case

IMAGE_INSTALL_append = &quot; sshd&quot;
PREFERRED_PROVIDER_sshd=&quot;dropbear&quot;

meta/lib/oe/package_manager.py reported a package not found in the base feeds. The file image.bbclass starts copies IMAGE_INSTALL to PACKAGE_INSTALL and performs fix ups for multilib, etc. I added another function (rootfs_process_preferred_providers) to replace sshd in PACKAGE_INSTALL with dropbear. This eliminated the error.

The mega-manual is vague when it describes what can be specified in PREFERRED_PROVIDER: an item. And the code partially supports run-time packages as a valid item on the left. My implementation assumes a package name on the right.

Yocto bug 5044 suggests traversing from the package name to the virtual/* provider, but I have not thought through how this might work.

IMAGE_INSTALL_append = &quot; libasound-module-bluez&quot;
PREFERRED_PROVIDER_libasound-module-bluez=&quot;bluez4&quot;

I got this working on poky 1.6.3, but some changes to the bluez recipes on master seemed to mitigate the original problem.

See the bitbake/oe-core mailing list for the patches.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60997</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-04-10 10:25:27 +0000</bug_when>
    <thetext>Note that there is no virtual/bluez in this case to end up looking up, there is simply no way for bitbake to know which one to use and no syntax to tell it. There would appear to be a genuine case here for PREFERRED_RPROVIDER.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61277</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-04-15 06:07:11 +0000</bug_when>
    <thetext>The checking of provides was already added previously, we&apos;ve now added PREFRERRED_RPROVIDER support (http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=9f374c4e8523430ef2fc5cb492c3ece9786623d2) and updated the confusing provider (http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=7f9d01eb177021c022230ca15c293948faa1d962) so this is now all resolved.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>