All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix for YOCTO #6888
@ 2015-02-25 15:15 Cristian Iorga
  2015-02-25 15:15 ` [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain() Cristian Iorga
  0 siblings, 1 reply; 10+ messages in thread
From: Cristian Iorga @ 2015-02-25 15:15 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 40d80f9e019118ac7bcd268f21e350bc154a4a63:

  build-appliance-image: Update to master head revision (2015-02-24 23:38:02 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib ciorga/YB6888_t2
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ciorga/YB6888_t2

Cristian Iorga (1):
  meta/lib/oe/utils.py: properly implement both_contain()

 meta/lib/oe/utils.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

-- 
2.1.0



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

* [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()
  2015-02-25 15:15 [PATCH 0/1] Fix for YOCTO #6888 Cristian Iorga
@ 2015-02-25 15:15 ` Cristian Iorga
  2015-02-26 20:07   ` Burton, Ross
  2015-05-12  0:34   ` Andre McCurdy
  0 siblings, 2 replies; 10+ messages in thread
From: Cristian Iorga @ 2015-02-25 15:15 UTC (permalink / raw)
  To: openembedded-core

oe.utils.both_contain() just does a find() on the value
rather than splitting the value and then looking in the
list of split items. The result is that if you add a
feature to MACHINE_FEATURES that itself has a substring
that matches one of the values looked for when building
COMBINED_FEATURES, you end up with an incomprehensible
error (here with "ext2i" in MACHINE_FEATURES):

ERROR: Nothing RPROVIDES 'packagegroup-base-ext2'
(but /home/balister/src/oe-core/oe-core/meta/recipes-core/
/packagegroups/packagegroup-base.bb RDEPENDS on or otherwise requires it)

Fix [YOCTO #6888].

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
---
 meta/lib/oe/utils.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 1f84ba4..bedade2 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -42,7 +42,15 @@ def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
         return falsevalue
 
 def both_contain(variable1, variable2, checkvalue, d):
-    if d.getVar(variable1,1).find(checkvalue) != -1 and d.getVar(variable2,1).find(checkvalue) != -1:
+    val1 = d.getVar(variable1, True)
+    val2 = d.getVar(variable2, True)
+    val1 = set(val1.split())
+    val2 = set(val2.split())
+    if isinstance(checkvalue, basestring):
+        checkvalue = set(checkvalue.split())
+    else:
+        checkvalue = set(checkvalue)
+    if checkvalue.issubset(val1) and checkvalue.issubset(val2):
         return checkvalue
     else:
         return ""
-- 
2.1.0



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

* Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()
  2015-02-25 15:15 ` [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain() Cristian Iorga
@ 2015-02-26 20:07   ` Burton, Ross
  2015-02-26 20:19     ` Iorga, Cristian
  2015-05-12  0:34   ` Andre McCurdy
  1 sibling, 1 reply; 10+ messages in thread
From: Burton, Ross @ 2015-02-26 20:07 UTC (permalink / raw)
  To: Cristian Iorga; +Cc: OE-core

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

On 25 February 2015 at 15:15, Cristian Iorga <cristian.iorga@intel.com>
wrote:

> oe.utils.both_contain() just does a find() on the value
> rather than splitting the value and then looking in the
> list of split items. The result is that if you add a
> feature to MACHINE_FEATURES that itself has a substring
> that matches one of the values looked for when building
> COMBINED_FEATURES, you end up with an incomprehensible
> error (here with "ext2i" in MACHINE_FEATURES):
>

This looks right but you know what it needs: a test suite.  Add a small
test case that demonstrates it breaking before the fix and then working
after the fix.  We've been adding test cases to bitbake as bugs are found
and it's really helping demonstrate that changes work.

Ross

[-- Attachment #2: Type: text/html, Size: 1232 bytes --]

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

* Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()
  2015-02-26 20:07   ` Burton, Ross
@ 2015-02-26 20:19     ` Iorga, Cristian
  2015-02-26 20:34       ` Burton, Ross
  0 siblings, 1 reply; 10+ messages in thread
From: Iorga, Cristian @ 2015-02-26 20:19 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

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

Hi Ross,
Can you point me to a tutorial in this kind of test suites?
/Cristian

From: Burton, Ross [mailto:ross.burton@intel.com]
Sent: Thursday, February 26, 2015 10:08 PM
To: Iorga, Cristian
Cc: OE-core
Subject: Re: [OE-core] [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()


On 25 February 2015 at 15:15, Cristian Iorga <cristian.iorga@intel.com<mailto:cristian.iorga@intel.com>> wrote:
oe.utils.both_contain() just does a find() on the value
rather than splitting the value and then looking in the
list of split items. The result is that if you add a
feature to MACHINE_FEATURES that itself has a substring
that matches one of the values looked for when building
COMBINED_FEATURES, you end up with an incomprehensible
error (here with "ext2i" in MACHINE_FEATURES):

This looks right but you know what it needs: a test suite.  Add a small test case that demonstrates it breaking before the fix and then working after the fix.  We've been adding test cases to bitbake as bugs are found and it's really helping demonstrate that changes work.

Ross

[-- Attachment #2: Type: text/html, Size: 4435 bytes --]

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

* Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()
  2015-02-26 20:19     ` Iorga, Cristian
@ 2015-02-26 20:34       ` Burton, Ross
  2015-02-26 22:35         ` Paul Eggleton
  0 siblings, 1 reply; 10+ messages in thread
From: Burton, Ross @ 2015-02-26 20:34 UTC (permalink / raw)
  To: Iorga, Cristian; +Cc: OE-core

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

On 26 February 2015 at 20:19, Iorga, Cristian <cristian.iorga@intel.com>
wrote:

> Can you point me to a tutorial in this kind of test suites?
>
>
I sure can, see meta/lib/oe/tests/test_utils.py.  Should be fairly obvious.

Ross

[-- Attachment #2: Type: text/html, Size: 760 bytes --]

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

* Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()
  2015-02-26 20:34       ` Burton, Ross
@ 2015-02-26 22:35         ` Paul Eggleton
  2015-02-26 23:10           ` Burton, Ross
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Eggleton @ 2015-02-26 22:35 UTC (permalink / raw)
  To: Burton, Ross; +Cc: openembedded-core

On Thursday 26 February 2015 20:34:36 Burton, Ross wrote:
> On 26 February 2015 at 20:19, Iorga, Cristian <cristian.iorga@intel.com>
> 
> wrote:
> > Can you point me to a tutorial in this kind of test suites?
> 
> I sure can, see meta/lib/oe/tests/test_utils.py.  Should be fairly obvious.

Genuine question, which I should have asked last time those files were touched 
- how do those tests relate to oe-selftest tests?

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()
  2015-02-26 22:35         ` Paul Eggleton
@ 2015-02-26 23:10           ` Burton, Ross
  0 siblings, 0 replies; 10+ messages in thread
From: Burton, Ross @ 2015-02-26 23:10 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: OE-core

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

On 26 February 2015 at 22:35, Paul Eggleton <paul.eggleton@linux.intel.com>
wrote:

> Genuine question, which I should have asked last time those files were
> touched
> - how do those tests relate to oe-selftest tests?
>

Looks like they're unrelated.  As they're standard unittest modules it
should be fairly simple to teach oe-selftest to load them all, right?

(AR taken to file a bug)

Ross

[-- Attachment #2: Type: text/html, Size: 889 bytes --]

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

* Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()
  2015-02-25 15:15 ` [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain() Cristian Iorga
  2015-02-26 20:07   ` Burton, Ross
@ 2015-05-12  0:34   ` Andre McCurdy
  2015-05-12  8:40     ` Paul Eggleton
  1 sibling, 1 reply; 10+ messages in thread
From: Andre McCurdy @ 2015-05-12  0:34 UTC (permalink / raw)
  To: Cristian Iorga; +Cc: OE Core mailing list

On Wed, Feb 25, 2015 at 7:15 AM, Cristian Iorga
<cristian.iorga@intel.com> wrote:
> oe.utils.both_contain() just does a find() on the value
> rather than splitting the value and then looking in the
> list of split items. The result is that if you add a
> feature to MACHINE_FEATURES that itself has a substring
> that matches one of the values looked for when building
> COMBINED_FEATURES, you end up with an incomprehensible
> error (here with "ext2i" in MACHINE_FEATURES):
>
> ERROR: Nothing RPROVIDES 'packagegroup-base-ext2'
> (but /home/balister/src/oe-core/oe-core/meta/recipes-core/
> /packagegroups/packagegroup-base.bb RDEPENDS on or otherwise requires it)

This change seems to break COMBINED_FEATURES.

$ bitbake -e packagegroup-base | grep '^COMBINED_FEATURES='

dizzy:
  COMBINED_FEATURES="alsa         "

fido:
  COMBINED_FEATURES="set(['alsa'])         "


> Fix [YOCTO #6888].
>
> Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
> ---
>  meta/lib/oe/utils.py | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
> index 1f84ba4..bedade2 100644
> --- a/meta/lib/oe/utils.py
> +++ b/meta/lib/oe/utils.py
> @@ -42,7 +42,15 @@ def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
>          return falsevalue
>
>  def both_contain(variable1, variable2, checkvalue, d):
> -    if d.getVar(variable1,1).find(checkvalue) != -1 and d.getVar(variable2,1).find(checkvalue) != -1:
> +    val1 = d.getVar(variable1, True)
> +    val2 = d.getVar(variable2, True)
> +    val1 = set(val1.split())
> +    val2 = set(val2.split())
> +    if isinstance(checkvalue, basestring):
> +        checkvalue = set(checkvalue.split())
> +    else:
> +        checkvalue = set(checkvalue)
> +    if checkvalue.issubset(val1) and checkvalue.issubset(val2):
>          return checkvalue
>      else:
>          return ""
> --
> 2.1.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()
  2015-05-12  0:34   ` Andre McCurdy
@ 2015-05-12  8:40     ` Paul Eggleton
  2015-05-12 18:00       ` Andre McCurdy
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Eggleton @ 2015-05-12  8:40 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: openembedded-core

Hi Andre,

On Monday 11 May 2015 17:34:45 Andre McCurdy wrote:
> On Wed, Feb 25, 2015 at 7:15 AM, Cristian Iorga
> 
> <cristian.iorga@intel.com> wrote:
> > oe.utils.both_contain() just does a find() on the value
> > rather than splitting the value and then looking in the
> > list of split items. The result is that if you add a
> > feature to MACHINE_FEATURES that itself has a substring
> > that matches one of the values looked for when building
> > COMBINED_FEATURES, you end up with an incomprehensible
> > error (here with "ext2i" in MACHINE_FEATURES):
> > 
> > ERROR: Nothing RPROVIDES 'packagegroup-base-ext2'
> > (but /home/balister/src/oe-core/oe-core/meta/recipes-core/
> > /packagegroups/packagegroup-base.bb RDEPENDS on or otherwise requires it)
> 
> This change seems to break COMBINED_FEATURES.
> 
> $ bitbake -e packagegroup-base | grep '^COMBINED_FEATURES='
> 
> dizzy:
>   COMBINED_FEATURES="alsa         "
> 
> fido:
>   COMBINED_FEATURES="set(['alsa'])         "

Yes it did, unfortunately. There was a follow-up fix in master:

  http://cgit.openembedded.org/openembedded-core/commit/?id=c4ca9dbd4191fcff08e75035e3d276490ed80b05

This is included in Joshua's pending backport changeset for fido.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()
  2015-05-12  8:40     ` Paul Eggleton
@ 2015-05-12 18:00       ` Andre McCurdy
  0 siblings, 0 replies; 10+ messages in thread
From: Andre McCurdy @ 2015-05-12 18:00 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: OE Core mailing list

On Tue, May 12, 2015 at 1:40 AM, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> Hi Andre,
>
> On Monday 11 May 2015 17:34:45 Andre McCurdy wrote:
>> On Wed, Feb 25, 2015 at 7:15 AM, Cristian Iorga
>>
>> <cristian.iorga@intel.com> wrote:
>> > oe.utils.both_contain() just does a find() on the value
>> > rather than splitting the value and then looking in the
>> > list of split items. The result is that if you add a
>> > feature to MACHINE_FEATURES that itself has a substring
>> > that matches one of the values looked for when building
>> > COMBINED_FEATURES, you end up with an incomprehensible
>> > error (here with "ext2i" in MACHINE_FEATURES):
>> >
>> > ERROR: Nothing RPROVIDES 'packagegroup-base-ext2'
>> > (but /home/balister/src/oe-core/oe-core/meta/recipes-core/
>> > /packagegroups/packagegroup-base.bb RDEPENDS on or otherwise requires it)
>>
>> This change seems to break COMBINED_FEATURES.
>>
>> $ bitbake -e packagegroup-base | grep '^COMBINED_FEATURES='
>>
>> dizzy:
>>   COMBINED_FEATURES="alsa         "
>>
>> fido:
>>   COMBINED_FEATURES="set(['alsa'])         "
>
> Yes it did, unfortunately. There was a follow-up fix in master:
>
>   http://cgit.openembedded.org/openembedded-core/commit/?id=c4ca9dbd4191fcff08e75035e3d276490ed80b05
>
> This is included in Joshua's pending backport changeset for fido.

I see it now. Thanks Paul.

>
> Cheers,
> Paul
>
> --
>
> Paul Eggleton
> Intel Open Source Technology Centre


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

end of thread, other threads:[~2015-05-12 18:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-25 15:15 [PATCH 0/1] Fix for YOCTO #6888 Cristian Iorga
2015-02-25 15:15 ` [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain() Cristian Iorga
2015-02-26 20:07   ` Burton, Ross
2015-02-26 20:19     ` Iorga, Cristian
2015-02-26 20:34       ` Burton, Ross
2015-02-26 22:35         ` Paul Eggleton
2015-02-26 23:10           ` Burton, Ross
2015-05-12  0:34   ` Andre McCurdy
2015-05-12  8:40     ` Paul Eggleton
2015-05-12 18:00       ` 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.