All of lore.kernel.org
 help / color / mirror / Atom feed
* PREFERRED_VERSION with % wildcard picking unexpected version
@ 2015-12-01  5:13 Andre McCurdy
  2015-12-09 23:27 ` Nicolas Dechesne
  0 siblings, 1 reply; 6+ messages in thread
From: Andre McCurdy @ 2015-12-01  5:13 UTC (permalink / raw)
  To: bitbake-devel

I have two recipes within a single layer:

  stblinux_3.14-1.7.bb
  stblinux_3.14-1.8.bb

If PREFERRED_VERSION_stblinux is set to "3.14%", then I would expect
the version 3.14-1.8 recipe to be selected, however 3.14-1.7 gets
selected instead.

Reversing the order of files stored in pkg_pn[pn] seems to help. Is it
a reasonable solution?


diff --git a/lib/bb/providers.py b/lib/bb/providers.py
index 637e1fa..b7b1e46 100644
--- a/lib/bb/providers.py
+++ b/lib/bb/providers.py
@@ -234,6 +234,10 @@ def _filterProviders(providers, item, cfgData, dataCache):
     # than effectively random.
     providers.sort()

+    # Reverse the list to help ensure that multiple recipes with the same
+    # priority and preference are considered "highest version number first".
+    providers.reverse()
+
     # Collate providers by PN
     pkg_pn = {}
     for p in providers:


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: PREFERRED_VERSION with % wildcard picking unexpected version
  2015-12-01  5:13 PREFERRED_VERSION with % wildcard picking unexpected version Andre McCurdy
@ 2015-12-09 23:27 ` Nicolas Dechesne
  2015-12-09 23:32   ` Khem Raj
  2015-12-10  9:16   ` Martin Jansa
  0 siblings, 2 replies; 6+ messages in thread
From: Nicolas Dechesne @ 2015-12-09 23:27 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: bitbake-devel

On Tue, Dec 1, 2015 at 6:13 AM, Andre McCurdy <armccurdy@gmail.com> wrote:
> I have two recipes within a single layer:
>
>   stblinux_3.14-1.7.bb
>   stblinux_3.14-1.8.bb
>
> If PREFERRED_VERSION_stblinux is set to "3.14%", then I would expect
> the version 3.14-1.8 recipe to be selected, however 3.14-1.7 gets
> selected instead.
>
> Reversing the order of files stored in pkg_pn[pn] seems to help. Is it
> a reasonable solution?


I have a somewhat similar issue..

in oe-core we have GCCVERSION set to 5.%, if I add meta-linaro layer
which has gcc_5.1.bb (while OE has gcc_5.2.bb), I am seeing this:

$ bitbake -e gcc | grep ^PV
PV="5.1.0"

While I would expect 5.2.0 to be picked up.

This patch does not fix this issue, btw.

If I remove gcc_5.1.bb from my layers, then I can see:

$ bitbake -e gcc | grep ^PV
PV="5.2.0"


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PREFERRED_VERSION with % wildcard picking unexpected version
  2015-12-09 23:27 ` Nicolas Dechesne
@ 2015-12-09 23:32   ` Khem Raj
  2015-12-10  8:06     ` Nicolas Dechesne
  2015-12-10  9:16   ` Martin Jansa
  1 sibling, 1 reply; 6+ messages in thread
From: Khem Raj @ 2015-12-09 23:32 UTC (permalink / raw)
  To: Nicolas Dechesne; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 1413 bytes --]


> On Dec 9, 2015, at 3:27 PM, Nicolas Dechesne <nicolas.dechesne@linaro.org> wrote:
> 
> On Tue, Dec 1, 2015 at 6:13 AM, Andre McCurdy <armccurdy@gmail.com> wrote:
>> I have two recipes within a single layer:
>> 
>>  stblinux_3.14-1.7.bb
>>  stblinux_3.14-1.8.bb
>> 
>> If PREFERRED_VERSION_stblinux is set to "3.14%", then I would expect
>> the version 3.14-1.8 recipe to be selected, however 3.14-1.7 gets
>> selected instead.
>> 
>> Reversing the order of files stored in pkg_pn[pn] seems to help. Is it
>> a reasonable solution?
> 
> 
> I have a somewhat similar issue..
> 
> in oe-core we have GCCVERSION set to 5.%, if I add meta-linaro layer
> which has gcc_5.1.bb (while OE has gcc_5.2.bb), I am seeing this:
> 
> $ bitbake -e gcc | grep ^PV
> PV="5.1.0"
> 
> While I would expect 5.2.0 to be picked up.
> 
> This patch does not fix this issue, btw.
> 
> If I remove gcc_5.1.bb from my layers, then I can see:
> 
> $ bitbake -e gcc | grep ^PV
> PV=“5.2.0"

whats the order of your layer in bitbake search path. Secondly whats the LAYER_PRIORITY
if they are higher than oe-core then it will always choose the provider from the higher order layer
versions don’t matter.

> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PREFERRED_VERSION with % wildcard picking unexpected version
  2015-12-09 23:32   ` Khem Raj
@ 2015-12-10  8:06     ` Nicolas Dechesne
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Dechesne @ 2015-12-10  8:06 UTC (permalink / raw)
  To: Khem Raj; +Cc: bitbake-devel

On Thu, Dec 10, 2015 at 12:32 AM, Khem Raj <raj.khem@gmail.com> wrote:
> whats the order of your layer in bitbake search path. Secondly whats the LAYER_PRIORITY
> if they are higher than oe-core then it will always choose the provider from the higher order layer
> versions don’t matter.

you're right. It's a priority issue. meta-linaro-toolchain has a very
high priority.. I keep forgetting about this rule..
thanks


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PREFERRED_VERSION with % wildcard picking unexpected version
  2015-12-09 23:27 ` Nicolas Dechesne
  2015-12-09 23:32   ` Khem Raj
@ 2015-12-10  9:16   ` Martin Jansa
  2015-12-10 19:07     ` Andre McCurdy
  1 sibling, 1 reply; 6+ messages in thread
From: Martin Jansa @ 2015-12-10  9:16 UTC (permalink / raw)
  To: Nicolas Dechesne; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]

On Thu, Dec 10, 2015 at 12:27:36AM +0100, Nicolas Dechesne wrote:
> On Tue, Dec 1, 2015 at 6:13 AM, Andre McCurdy <armccurdy@gmail.com> wrote:
> > I have two recipes within a single layer:
> >
> >   stblinux_3.14-1.7.bb
> >   stblinux_3.14-1.8.bb
> >
> > If PREFERRED_VERSION_stblinux is set to "3.14%", then I would expect
> > the version 3.14-1.8 recipe to be selected, however 3.14-1.7 gets
> > selected instead.
> >
> > Reversing the order of files stored in pkg_pn[pn] seems to help. Is it
> > a reasonable solution?
> 
> 
> I have a somewhat similar issue..
> 
> in oe-core we have GCCVERSION set to 5.%, if I add meta-linaro layer
> which has gcc_5.1.bb (while OE has gcc_5.2.bb), I am seeing this:
> 
> $ bitbake -e gcc | grep ^PV
> PV="5.1.0"
> 
> While I would expect 5.2.0 to be picked up.
> 
> This patch does not fix this issue, btw.
> 
> If I remove gcc_5.1.bb from my layers, then I can see:
> 
> $ bitbake -e gcc | grep ^PV
> PV="5.2.0"

PREFERRED_VERSION was always meant to identify only 1 provider, the wildcard
is used only to say that you cannot specify the exact value - e.g. for
floating versions from SCM.

So if you have a layer with another recipe with version matching "5.%"
you're supposed to set PREFERRED_VERSION to more specific version.

See longer explanation in:
http://comments.gmane.org/gmane.comp.sysutils.bitbake.devel/1038

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PREFERRED_VERSION with % wildcard picking unexpected version
  2015-12-10  9:16   ` Martin Jansa
@ 2015-12-10 19:07     ` Andre McCurdy
  0 siblings, 0 replies; 6+ messages in thread
From: Andre McCurdy @ 2015-12-10 19:07 UTC (permalink / raw)
  To: Martin Jansa; +Cc: bitbake-devel

Hi Nicolas,

On Thu, Dec 10, 2015 at 1:16 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Thu, Dec 10, 2015 at 12:27:36AM +0100, Nicolas Dechesne wrote:
>> On Tue, Dec 1, 2015 at 6:13 AM, Andre McCurdy <armccurdy@gmail.com> wrote:
>> > I have two recipes within a single layer:
>> >
>> >   stblinux_3.14-1.7.bb
>> >   stblinux_3.14-1.8.bb
>> >
>> > If PREFERRED_VERSION_stblinux is set to "3.14%", then I would expect
>> > the version 3.14-1.8 recipe to be selected, however 3.14-1.7 gets
>> > selected instead.
>> >
>> > Reversing the order of files stored in pkg_pn[pn] seems to help. Is it
>> > a reasonable solution?
>>
>> I have a somewhat similar issue..
>>
>> in oe-core we have GCCVERSION set to 5.%, if I add meta-linaro layer
>> which has gcc_5.1.bb (while OE has gcc_5.2.bb), I am seeing this:
>>
>> $ bitbake -e gcc | grep ^PV
>> PV="5.1.0"
>>
>> While I would expect 5.2.0 to be picked up.
>>
>> This patch does not fix this issue, btw.
>>
>> If I remove gcc_5.1.bb from my layers, then I can see:
>>
>> $ bitbake -e gcc | grep ^PV
>> PV="5.2.0"

I think we've been seeing related but not identical issues.

Behaviour of PREFERRED_VERSION with a wildcard seems to be to take the
first possible match when testing the preferred version against a list
of available versions which are sorted first by layer priority (which
explains the behaviour you saw) and second by lexical order (ie
3.14-1.7 comes before 3.14-1.8, which explains the behaviour I have
seen).

My patch effectively reversed the order of the lexical sort, so only
affects the case where the wildcard pattern matches multiple versions
within the same layer priority - so it would not change the behaviour
you saw.

> PREFERRED_VERSION was always meant to identify only 1 provider, the wildcard
> is used only to say that you cannot specify the exact value - e.g. for
> floating versions from SCM.
>
> So if you have a layer with another recipe with version matching "5.%"
> you're supposed to set PREFERRED_VERSION to more specific version.
>
> See longer explanation in:
> http://comments.gmane.org/gmane.comp.sysutils.bitbake.devel/1038

Thanks for digging out the history. I've sent a patch to the oe-core
list to try to document that the wildcard should be avoided in cases
where it might match more than one available version.

> --
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-10 19:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01  5:13 PREFERRED_VERSION with % wildcard picking unexpected version Andre McCurdy
2015-12-09 23:27 ` Nicolas Dechesne
2015-12-09 23:32   ` Khem Raj
2015-12-10  8:06     ` Nicolas Dechesne
2015-12-10  9:16   ` Martin Jansa
2015-12-10 19:07     ` Andre McCurdy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.