Skip to contentSkip to conversation

Fix for YOCTO #6888

PATCH In review Cristian Iorga 4 participants 10 messages Feb 25, 2015 – May 12, 2015

lore
Share & tools
lore
#0 lore raw

cover Fix for YOCTO #6888

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(-)
Signature · 1 line
2.1.0
#1 lore raw

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

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].

---
 meta/lib/oe/utils.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
meta/lib/oe/utils.py +9 -1
index 1f84ba4..bedade2 100644
@@ -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 ""
Signature · 1 line
2.1.0
#2 lore raw

Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()

Quoted 8 lines · Cristian Iorga

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

#3 lore raw

Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()

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

From: Burton, Ross [mailto:[email protected]]
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 <[email protected]<mailto:[email protected]>> 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

#4 lore raw

Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()

Quoted 3 lines · Cristian

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

#5 lore raw

Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()

Quoted 6 lines · Ross

On 26 February 2015 at 20:19, Iorga, Cristian <[email protected]>

Quoted 1 line · 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

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#6 lore raw

Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()

Quoted 4 lines · Paul Eggleton

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

#7 lore raw

Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()

In reply to Cristian Iorga
Quoted 11 lines · Cristian Iorga

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']) "

Quoted 36 lines

Fix [YOCTO #6888].

---
 meta/lib/oe/utils.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
meta/lib/oe/utils.py +9 -2
index 1f84ba4..bedade2 100644
@@ -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
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#8 lore raw

Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()

Hi Andre,

Quoted 17 lines · On Monday 11 May 2015 17:34:45 Andre McCurdy wrote:

On Wed, Feb 25, 2015 at 7:15 AM, Cristian Iorga

Quoted 11 lines · <[email protected]> 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.

Quoted 7 lines
$ 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

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#9 lore raw

Re: [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()

Quoted 25 lines · Paul Eggleton

Hi Andre,

Quoted 22 lines · On Monday 11 May 2015 17:34:45 Andre McCurdy wrote:

On Wed, Feb 25, 2015 at 7:15 AM, Cristian Iorga

Quoted 11 lines · <[email protected]> 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 "

Quoted 8 lines
Quoted 2 lines

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.

Quoted 8 lines

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre