Patchwork [13/22] sanity: Dont throw a warning if TUNE_PKGARCH is in PACKAGE_ARCHS twice

login
register
mail settings
Submitter Saul Wold
Date Aug. 1, 2011, 7:36 a.m.
Message ID <d16f8ea81d614e2dd5608cbf8b773de9764b8d56.1312182844.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/8903/
State New, archived
Headers show

Comments

Saul Wold - Aug. 1, 2011, 7:36 a.m.
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/classes/sanity.bbclass |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
Richard Purdie - Aug. 1, 2011, 1:03 p.m.
On Mon, 2011-08-01 at 00:36 -0700, Saul Wold wrote:
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
>  meta/classes/sanity.bbclass |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 999e15d..dc11c9e 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -383,12 +383,14 @@ def check_sanity(e):
>      dups = []
>  
>      for pa in pkgarchs.split():
> -    	if seen.get(pa, 0) == 1:
> +	if pa == tunepkg:
> +	    tunefound = True
> +            if seen.get(pa, 0) == 1:
> +               pkgarchs.remove(pa)
> +    	elif seen.get(pa, 0) == 1:
>  	    dups.append(pa)
>  	else:
>  	    seen[pa] = 1
> -	if pa == tunepkg:
> -	    tunefound = True
>  
>      if len(dups):
>         messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)

How about we don't put duplicates in there in the first place?

Which board/tune files is this occurring with?

Cheers,

Richard
Koen Kooi - Aug. 1, 2011, 1:28 p.m.
Op 1 aug. 2011, om 15:03 heeft Richard Purdie het volgende geschreven:

> On Mon, 2011-08-01 at 00:36 -0700, Saul Wold wrote:
>> Signed-off-by: Saul Wold <sgw@linux.intel.com>
>> ---
>> meta/classes/sanity.bbclass |    8 +++++---
>> 1 files changed, 5 insertions(+), 3 deletions(-)
>> 
>> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
>> index 999e15d..dc11c9e 100644
>> --- a/meta/classes/sanity.bbclass
>> +++ b/meta/classes/sanity.bbclass
>> @@ -383,12 +383,14 @@ def check_sanity(e):
>>     dups = []
>> 
>>     for pa in pkgarchs.split():
>> -    	if seen.get(pa, 0) == 1:
>> +	if pa == tunepkg:
>> +	    tunefound = True
>> +            if seen.get(pa, 0) == 1:
>> +               pkgarchs.remove(pa)
>> +    	elif seen.get(pa, 0) == 1:
>> 	    dups.append(pa)
>> 	else:
>> 	    seen[pa] = 1
>> -	if pa == tunepkg:
>> -	    tunefound = True
>> 
>>     if len(dups):
>>        messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
> 
> How about we don't put duplicates in there in the first place?

AIUI this is fatal in OE classic as well, so there really shouldn't be any duplicates in PACKAGE_(EXTRA_)ARCHS
Kumar Gala - Aug. 1, 2011, 2:11 p.m.
On Aug 1, 2011, at 8:03 AM, Richard Purdie wrote:

> On Mon, 2011-08-01 at 00:36 -0700, Saul Wold wrote:
>> Signed-off-by: Saul Wold <sgw@linux.intel.com>
>> ---
>> meta/classes/sanity.bbclass |    8 +++++---
>> 1 files changed, 5 insertions(+), 3 deletions(-)
>> 
>> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
>> index 999e15d..dc11c9e 100644
>> --- a/meta/classes/sanity.bbclass
>> +++ b/meta/classes/sanity.bbclass
>> @@ -383,12 +383,14 @@ def check_sanity(e):
>>     dups = []
>> 
>>     for pa in pkgarchs.split():
>> -    	if seen.get(pa, 0) == 1:
>> +	if pa == tunepkg:
>> +	    tunefound = True
>> +            if seen.get(pa, 0) == 1:
>> +               pkgarchs.remove(pa)
>> +    	elif seen.get(pa, 0) == 1:
>> 	    dups.append(pa)
>> 	else:
>> 	    seen[pa] = 1
>> -	if pa == tunepkg:
>> -	    tunefound = True
>> 
>>     if len(dups):
>>        messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
> 
> How about we don't put duplicates in there in the first place?
> 
> Which board/tune files is this occurring with?

Yeah, not sure about this one, I added the sanity check to find this early.  Ran into issues with my PPC patch set and took a while to find (thus figured a sanity check made sense to check early on).

- k
Khem Raj - Aug. 1, 2011, 5:34 p.m.
On (01/08/11 09:11), Kumar Gala wrote:
> 
> On Aug 1, 2011, at 8:03 AM, Richard Purdie wrote:
> 
> > On Mon, 2011-08-01 at 00:36 -0700, Saul Wold wrote:
> >> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> >> ---
> >> meta/classes/sanity.bbclass |    8 +++++---
> >> 1 files changed, 5 insertions(+), 3 deletions(-)
> >> 
> >> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> >> index 999e15d..dc11c9e 100644
> >> --- a/meta/classes/sanity.bbclass
> >> +++ b/meta/classes/sanity.bbclass
> >> @@ -383,12 +383,14 @@ def check_sanity(e):
> >>     dups = []
> >> 
> >>     for pa in pkgarchs.split():
> >> -    	if seen.get(pa, 0) == 1:
> >> +	if pa == tunepkg:
> >> +	    tunefound = True
> >> +            if seen.get(pa, 0) == 1:
> >> +               pkgarchs.remove(pa)
> >> +    	elif seen.get(pa, 0) == 1:
> >> 	    dups.append(pa)
> >> 	else:
> >> 	    seen[pa] = 1
> >> -	if pa == tunepkg:
> >> -	    tunefound = True
> >> 
> >>     if len(dups):
> >>        messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
> > 
> > How about we don't put duplicates in there in the first place?
> > 
> > Which board/tune files is this occurring with?
> 
> Yeah, not sure about this one, I added the sanity check to find this early.  Ran into issues with my PPC patch set and took a while to find (thus figured a sanity check made sense to check early on).

I think the issue is when TUNE_PKGARCH does not end up in the
PACKAGE_ARCHS and then package managers dont pick the ipks/rpms/debs
which are under that dir in deploy/ipk.
Usually we have been doing += to PACKAGE_EXTRA_ARCH
variable in layers but with latest tune overhaul += does not work
and we have to do _append/_prepend. I dont know if that is Kumar's
original problem 

> 
> - k
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Kumar Gala - Aug. 1, 2011, 6:51 p.m.
On Aug 1, 2011, at 12:34 PM, Khem Raj wrote:

> On (01/08/11 09:11), Kumar Gala wrote:
>> 
>> On Aug 1, 2011, at 8:03 AM, Richard Purdie wrote:
>> 
>>> On Mon, 2011-08-01 at 00:36 -0700, Saul Wold wrote:
>>>> Signed-off-by: Saul Wold <sgw@linux.intel.com>
>>>> ---
>>>> meta/classes/sanity.bbclass |    8 +++++---
>>>> 1 files changed, 5 insertions(+), 3 deletions(-)
>>>> 
>>>> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
>>>> index 999e15d..dc11c9e 100644
>>>> --- a/meta/classes/sanity.bbclass
>>>> +++ b/meta/classes/sanity.bbclass
>>>> @@ -383,12 +383,14 @@ def check_sanity(e):
>>>>    dups = []
>>>> 
>>>>    for pa in pkgarchs.split():
>>>> -    	if seen.get(pa, 0) == 1:
>>>> +	if pa == tunepkg:
>>>> +	    tunefound = True
>>>> +            if seen.get(pa, 0) == 1:
>>>> +               pkgarchs.remove(pa)
>>>> +    	elif seen.get(pa, 0) == 1:
>>>> 	    dups.append(pa)
>>>> 	else:
>>>> 	    seen[pa] = 1
>>>> -	if pa == tunepkg:
>>>> -	    tunefound = True
>>>> 
>>>>    if len(dups):
>>>>       messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
>>> 
>>> How about we don't put duplicates in there in the first place?
>>> 
>>> Which board/tune files is this occurring with?
>> 
>> Yeah, not sure about this one, I added the sanity check to find this early.  Ran into issues with my PPC patch set and took a while to find (thus figured a sanity check made sense to check early on).
> 
> I think the issue is when TUNE_PKGARCH does not end up in the
> PACKAGE_ARCHS and then package managers dont pick the ipks/rpms/debs
> which are under that dir in deploy/ipk.
> Usually we have been doing += to PACKAGE_EXTRA_ARCH
> variable in layers but with latest tune overhaul += does not work
> and we have to do _append/_prepend. I dont know if that is Kumar's
> original problem 

Yeah, its why I added the sanity check to make sure TUNE_PKGARCH was in the PACKAGE_ARCHS list.

- k
Khem Raj - Aug. 1, 2011, 6:59 p.m.
On Mon, Aug 1, 2011 at 11:51 AM, Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Aug 1, 2011, at 12:34 PM, Khem Raj wrote:
>
>> On (01/08/11 09:11), Kumar Gala wrote:
>>>
>>> On Aug 1, 2011, at 8:03 AM, Richard Purdie wrote:
>>>
>>>> On Mon, 2011-08-01 at 00:36 -0700, Saul Wold wrote:
>>>>> Signed-off-by: Saul Wold <sgw@linux.intel.com>
>>>>> ---
>>>>> meta/classes/sanity.bbclass |    8 +++++---
>>>>> 1 files changed, 5 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
>>>>> index 999e15d..dc11c9e 100644
>>>>> --- a/meta/classes/sanity.bbclass
>>>>> +++ b/meta/classes/sanity.bbclass
>>>>> @@ -383,12 +383,14 @@ def check_sanity(e):
>>>>>    dups = []
>>>>>
>>>>>    for pa in pkgarchs.split():
>>>>> -          if seen.get(pa, 0) == 1:
>>>>> +  if pa == tunepkg:
>>>>> +      tunefound = True
>>>>> +            if seen.get(pa, 0) == 1:
>>>>> +               pkgarchs.remove(pa)
>>>>> +          elif seen.get(pa, 0) == 1:
>>>>>        dups.append(pa)
>>>>>    else:
>>>>>        seen[pa] = 1
>>>>> -  if pa == tunepkg:
>>>>> -      tunefound = True
>>>>>
>>>>>    if len(dups):
>>>>>       messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
>>>>
>>>> How about we don't put duplicates in there in the first place?
>>>>
>>>> Which board/tune files is this occurring with?
>>>
>>> Yeah, not sure about this one, I added the sanity check to find this early.  Ran into issues with my PPC patch set and took a while to find (thus figured a sanity check made sense to check early on).
>>
>> I think the issue is when TUNE_PKGARCH does not end up in the
>> PACKAGE_ARCHS and then package managers dont pick the ipks/rpms/debs
>> which are under that dir in deploy/ipk.
>> Usually we have been doing += to PACKAGE_EXTRA_ARCH
>> variable in layers but with latest tune overhaul += does not work
>> and we have to do _append/_prepend. I dont know if that is Kumar's
>> original problem
>
> Yeah, its why I added the sanity check to make sure TUNE_PKGARCH was in the PACKAGE_ARCHS list.

right now ppc is bitten by this issue. I cannt build images for qemuppc
in oe-core atm since TUNE_PKGARCH = "powerpcppc603e" and therefore ipks
are put in the subdir with same name which opkg does not know about
powerpcppc603e as a PACKAGE_ARCH so doesnt search this subdir for
packages.

>
> - k
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Richard Purdie - Aug. 2, 2011, 1:39 p.m.
On Mon, 2011-08-01 at 11:59 -0700, Khem Raj wrote:
> On Mon, Aug 1, 2011 at 11:51 AM, Kumar Gala <galak@kernel.crashing.org> wrote:
> >
> > On Aug 1, 2011, at 12:34 PM, Khem Raj wrote:
> >
> >> On (01/08/11 09:11), Kumar Gala wrote:
> >>>
> >>> On Aug 1, 2011, at 8:03 AM, Richard Purdie wrote:
> >>>
> >>>> On Mon, 2011-08-01 at 00:36 -0700, Saul Wold wrote:
> >>>>> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> >>>>> ---
> >>>>> meta/classes/sanity.bbclass |    8 +++++---
> >>>>> 1 files changed, 5 insertions(+), 3 deletions(-)
> >>>>>
> >>>>> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> >>>>> index 999e15d..dc11c9e 100644
> >>>>> --- a/meta/classes/sanity.bbclass
> >>>>> +++ b/meta/classes/sanity.bbclass
> >>>>> @@ -383,12 +383,14 @@ def check_sanity(e):
> >>>>>    dups = []
> >>>>>
> >>>>>    for pa in pkgarchs.split():
> >>>>> -          if seen.get(pa, 0) == 1:
> >>>>> +  if pa == tunepkg:
> >>>>> +      tunefound = True
> >>>>> +            if seen.get(pa, 0) == 1:
> >>>>> +               pkgarchs.remove(pa)
> >>>>> +          elif seen.get(pa, 0) == 1:
> >>>>>        dups.append(pa)
> >>>>>    else:
> >>>>>        seen[pa] = 1
> >>>>> -  if pa == tunepkg:
> >>>>> -      tunefound = True
> >>>>>
> >>>>>    if len(dups):
> >>>>>       messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
> >>>>
> >>>> How about we don't put duplicates in there in the first place?
> >>>>
> >>>> Which board/tune files is this occurring with?
> >>>
> >>> Yeah, not sure about this one, I added the sanity check to find this early.  Ran into issues with my PPC patch set and took a while to find (thus figured a sanity check made sense to check early on).
> >>
> >> I think the issue is when TUNE_PKGARCH does not end up in the
> >> PACKAGE_ARCHS and then package managers dont pick the ipks/rpms/debs
> >> which are under that dir in deploy/ipk.
> >> Usually we have been doing += to PACKAGE_EXTRA_ARCH
> >> variable in layers but with latest tune overhaul += does not work
> >> and we have to do _append/_prepend. I dont know if that is Kumar's
> >> original problem
> >
> > Yeah, its why I added the sanity check to make sure TUNE_PKGARCH was in the PACKAGE_ARCHS list.
> 
> right now ppc is bitten by this issue. I cannt build images for qemuppc
> in oe-core atm since TUNE_PKGARCH = "powerpcppc603e" and therefore ipks
> are put in the subdir with same name which opkg does not know about
> powerpcppc603e as a PACKAGE_ARCH so doesnt search this subdir for
> packages.

I'm fine with the sanity check, thats great and I merged that. What I
don't like is automagically removing duplicates. The variable is order
sensitive and who do we know which one to remove?

Cheers,

Rcichard

Patch

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 999e15d..dc11c9e 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -383,12 +383,14 @@  def check_sanity(e):
     dups = []
 
     for pa in pkgarchs.split():
-    	if seen.get(pa, 0) == 1:
+	if pa == tunepkg:
+	    tunefound = True
+            if seen.get(pa, 0) == 1:
+               pkgarchs.remove(pa)
+    	elif seen.get(pa, 0) == 1:
 	    dups.append(pa)
 	else:
 	    seen[pa] = 1
-	if pa == tunepkg:
-	    tunefound = True
 
     if len(dups):
        messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)