Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
To: openembedded-core@lists.openembedded.org,
	 Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: Re: Does support for external toolchains working in current OE?
Date: Fri, 05 Apr 2013 14:21:06 +0200	[thread overview]
Message-ID: <515EC1B2.4060103@linaro.org> (raw)
In-Reply-To: <515E976C.8060302@linaro.org>

W dniu 05.04.2013 11:20, Marcin Juszkiewicz pisze:

> ERROR: Multiple .bb files are due to be built which each provide virtual/libc (/home/hrw/HDD/devel/canonical/aarch64/openembedded/repos/openembedded-core/meta/recipes-core/eglibc/eglibc_2.17.bb /home/hrw/HDD/devel/canonical/aarch64/openembedded/repos/meta-linaro/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb).
>  This usually means one provides something the other doesn't and should.

Let's enable debug:

DEBUG: providers for virtual/libc are: ['eglibc', 'external-linaro-toolchain']
NOTE: selecting external-linaro-toolchain to satisfy virtual/libc due to PREFERRED_PROVIDERS
DEBUG: sorted providers for virtual/libc are: ['/home/hrw/HDD/devel/canonical/aarch64/openembedded/repos/meta-linaro/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb', '/home/hrw/HDD/devel/canonical/aarch64/openembedded/repos/openembedded-core/meta/recipes-core/eglibc/eglibc_2.17.bb']
DEBUG: adding /home/hrw/HDD/devel/canonical/aarch64/openembedded/repos/meta-linaro/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb to satisfy virtual/libc
DEBUG: adding /home/hrw/HDD/devel/canonical/aarch64/openembedded/repos/openembedded-core/meta/recipes-core/eglibc/eglibc_2.17.bb to satisfy virtual/libc

And now - let's dig deep into BitBake code. We want two files:

- lib/bb/providers.py
- lib/bb/taskdata.py

1. Bitbake jumps into taskdata/add_provider_internal(). 
2. Then asks bb.providers.filterProviders() 
   "is there any provider for 'virtual/libc'"?
3. In providers/_filterProviders this output is printed:
   "DEBUG: providers for virtual/libc are: ['eglibc', 'external-linaro-toolchain']"
4. providers/filterProviders() (note lack of "_") checks for
   PREFERRED_PROVIDER_virtual/libc and outputs:
   NOTE: selecting external-linaro-toolchain to satisfy virtual/libc due to PREFERRED_PROVIDERS
   sets foundUnique to True, outputs:
   DEBUG: sorted providers for virtual/libc are: ['/home/hrw/HDD/devel/canonical/aarch64/openembedded/repos/meta-linaro/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb', '/home/hrw/HDD/devel/canonical/aarch64/openembedded/repos/openembedded-core/meta/recipes-core/eglibc/eglibc_2.17.bb']
   and returns all providers + foundUnique
5. We are back at taskdata/add_provider_internal() and we
   have more then one entry in "eligible" array plus
   foundUnique set to True.
6. Here we are happy of results and skips two "if" checks.
7. Then we add each entry as good one with this output:
DEBUG: adding /home/hrw/HDD/devel/canonical/aarch64/openembedded/repos/meta-linaro/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb to satisfy virtual/libc
DEBUG: adding /home/hrw/HDD/devel/canonical/aarch64/openembedded/repos/openembedded-core/meta/recipes-core/eglibc/eglibc_2.17.bb to satisfy virtual/libc

The question is - why providers/filterProviders() returns more 
then one entry when it founds that one of them is preferred?

So I got with this change:

diff --git a/lib/bb/providers.py b/lib/bb/providers.py
index fcee6dc..0b37c44 100644
--- a/lib/bb/providers.py
+++ b/lib/bb/providers.py
@@ -296,8 +296,7 @@ def filterProviders(providers, item, cfgData, dataCache):
             pn = dataCache.pkg_fn[p]
             if dataCache.preferred[item] == pn:
                 logger.verbose("selecting %s to satisfy %s due to PREFERRED_PROVIDERS", pn, item)
-                eligible.remove(p)
-                eligible = [p] + eligible
+                eligible = [p]
                 foundUnique = True
                 break

And when I added "eglibc" into PROVIDES in 
external-linaro-toolchain.bb I got bitbake pass!!!
NO MULTIPLE RECIPES!!! :D



  parent reply	other threads:[~2013-04-05 12:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05  9:20 Does support for external toolchains working in current OE? Marcin Juszkiewicz
2013-04-05  9:26 ` Marcin Juszkiewicz
2013-04-05  9:54 ` Richard Purdie
2013-04-05  9:56   ` Marcin Juszkiewicz
2013-04-05 10:11     ` Richard Purdie
2013-04-05 11:48       ` Marcin Juszkiewicz
2013-04-05 12:21 ` Marcin Juszkiewicz [this message]
2013-04-05 12:26   ` Marcin Juszkiewicz
2013-04-05 12:31   ` Richard Purdie
2013-04-05 21:20 ` Martin Jansa
2013-04-05 22:08   ` Chris Larson
2013-04-05 22:10     ` Martin Jansa
2013-04-06 12:43       ` Martin Jansa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=515EC1B2.4060103@linaro.org \
    --to=marcin.juszkiewicz@linaro.org \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox