<?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>3622</bug_id>
          
          <creation_ts>2012-12-19 13:17:09 +0000</creation_ts>
          <short_desc>select preferred provider for multiple runtime providers</short_desc>
          <delta_ts>2013-01-21 14:27:29 +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>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Jansa">Martin.Jansa</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>28374</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2012-12-19 13:17:09 +0000</bug_when>
    <thetext>I know that selecting runtime providers isn&apos;t well implemented in bitbake, but I&apos;ve found interesting case:

When building world I always got:
ERROR: Multiple .bb files are due to be built which each provide udev (/OE/jansa-test/shr-core/meta-openembedded/meta-systemd/recipes-core/systemd/systemd_git.bb /OE/jansa-test/shr-core/openembedded-core/meta/recipes-core/udev/udev_182.bb).
 This usually means one provides something the other doesn&apos;t and should.

First part of fix was to define PACKAGES_DYNAMIC:
http://git.openembedded.org/meta-openembedded/commit/?id=39aabff8e0f9b3fa7c729dfc0593b3cea1762784
and then it worked after removing all udev recipes in layers.

python-pyudev has libudev in RDEPENDS
udev recipe has libudev explicitly in PACKAGES
systemd recipe splits all lib* packages dynamically:
  do_split_packages(d, systemdlibdir, &apos;^lib(.*)\.so\.*&apos;, &apos;lib%s&apos;, &apos;Systemd %s
  PACKAGES_DYNAMIC += &quot;^lib(udev|gudev|systemd).*&quot;

But systemd is never selected as runtime provider and is not even listed in eligible providers, because of bitbake/lib/bb/providers.py:getRuntimeProviders optimization to search dynamic package only when other provider wasn&apos;t found yet (using PACKAGES and RPROVIDES).

If I remove that optimization I can select systemd as provider:
DEBUG: providers for libudev are: [&apos;systemd&apos;, &apos;udev&apos;]
DEBUG: checking PREFERRED_PROVIDER_systemd (value None) against [&apos;systemd&apos;, &apos;udev&apos;]
DEBUG: checking PREFERRED_PROVIDER_systemd-git (value None) against [&apos;systemd&apos;, &apos;udev&apos;]
DEBUG: checking PREFERRED_PROVIDER_systemd-git-r20 (value None) against [&apos;systemd&apos;, &apos;udev&apos;]
DEBUG: checking PREFERRED_PROVIDER_udev (value systemd) against [&apos;systemd&apos;, &apos;udev&apos;]
NOTE: selecting systemd to satisfy runtime libudev due to PREFERRED_PROVIDER_udev = systemd
DEBUG: sorted providers for libudev are: [&apos;/OE/jansa-test/shr-core/meta-openembedded/meta-systemd/recipes-core/systemd/systemd_git.bb&apos;, &apos;/OE/jansa-test/shr-core/openembedded-core/meta/recipes-core/udev/udev_182.bb&apos;]
DEBUG: adding &apos;/OE/jansa-test/shr-core/meta-openembedded/meta-systemd/recipes-core/systemd/systemd_git.bb&apos; to satisfy runtime &apos;libudev&apos;

Is there some other reason for not looking in dynamic packages other then optimization? It was introduced in first version of getProvidersRun:
commit 02a43ca809811ef6762c3db6a0b1f53b95d03966
Author: Holger Hans Peter Freyther &lt;zecke@selfish.org&gt;
Date:   Thu Jan 12 22:57:25 2006 +0000

I guess I can work around this by adding libudev to PACKAGES directly and remove it from PACKAGES_DYNAMIC. But at least I will use this report in such change to explain why it&apos;s needed.

Also with that optimization removed I can see few more notes about multiple providers:
NOTE: multiple providers are available for runtime gtk-theme-e17lookalike (gtk-theme-e17lookalike, gtk-engines)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-e17lookalike
NOTE: multiple providers are available for runtime gtk-theme-sato (gtk-engines, gtk-sato-engine)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-sato
NOTE: multiple providers are available for runtime gtk-theme-clearlooks-gtkrc-dev (gtk-engines, gtk-theme-clearlooks-gtkrc)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-clearlooks-gtkrc-dev
NOTE: multiple providers are available for runtime gtk-theme-clearlooks-gtkrc (gtk-theme-clearlooks-gtkrc, gtk-engines)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-clearlooks-gtkrc
NOTE: multiple providers are available for runtime libpostproc-dev (libav, libpostproc)
NOTE: consider defining a PREFERRED_PROVIDER entry to match libpostproc-dev
NOTE: multiple providers are available for runtime libpostproc (libpostproc, libav)
NOTE: consider defining a PREFERRED_PROVIDER entry to match libpostproc
NOTE: multiple providers are available for runtime gtk-theme-neo (gtk-theme-neo, gtk-engines)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-neo
NOTE: multiple providers are available for runtime pam-plugin-ck-connector (consolekit, libpam)
NOTE: consider defining a PREFERRED_PROVIDER entry to match pam-plugin-ck-connector
NOTE: multiple providers are available for runtime gtk-theme-e17lookalike-dev (gtk-engines, gtk-theme-e17lookalike)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-e17lookalike-dev
NOTE: multiple providers are available for runtime gtk-theme-e17lookalike-gtkrc (gtk-engines, gtk-theme-e17lookalike)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-e17lookalike-gtkrc
NOTE: multiple providers are available for runtime gtk-theme-torturer-dev (gtk-engines, gtk-theme-torturer)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-torturer-dev
NOTE: multiple providers are available for runtime gtk-theme-torturer (gtk-theme-torturer, gtk-engines)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-torturer
NOTE: multiple providers are available for runtime gtk-theme-neo-dev (gtk-theme-neo, gtk-engines)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-neo-dev
NOTE: multiple providers are available for runtime gtk-theme-neo-gtkrc (gtk-theme-neo, gtk-engines)
NOTE: consider defining a PREFERRED_PROVIDER entry to match gtk-theme-neo-gtkrc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28983</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-01-21 14:27:29 +0000</bug_when>
    <thetext>Its generally thought that if you have two providers of something, they&apos;d happen at equal levels, i.e. either both as packages_dynamic or both as PACKAGES.

The speed of packages dynamic processing is sadly much slower due to the regexps involved.

So I&apos;d consider this more as an interesting corner case than a true error. I&apos;d also note that for other reasons we need to put skipPackage or at the very least EXCLUDE_FROM_WORLD in the udev/systemd recipes to stop them being built in parallel for other reasons.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>