[bitbake-devel,1/1] bitbake: cookerdata: Check duplicated BBFILE_COLLECTIONS

Submitted by Robert Yang on Jan. 25, 2019, 7:09 a.m. | Patch ID: 158225

Details

Message ID 070002fb5989fd3c629d06ce77d9b33d11982a18.1548400142.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

Robert Yang Jan. 25, 2019, 7:09 a.m.
It shouldn't work when there are duplicated BBFILE_COLLECTIONS.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 bitbake/lib/bb/cookerdata.py | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 5df66e6..09412e2 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -391,7 +391,11 @@  class CookerDataBuilder(object):
                 bb.fatal("BBFILES_DYNAMIC entries must be of the form <collection name>:<filename pattern>, not:\n    %s" % "\n    ".join(invalid))
 
             layerseries = set((data.getVar("LAYERSERIES_CORENAMES") or "").split())
+            collections_tmp = collections[:]
             for c in collections:
+                collections_tmp.remove(c)
+                if c in collections_tmp:
+                    bb.fatal("Found duplicated BBFILE_COLLECTIONS '%s', check bblayers.conf or layer.conf to fix it." % c)
                 compat = set((data.getVar("LAYERSERIES_COMPAT_%s" % c) or "").split())
                 if compat and not (compat & layerseries):
                     bb.fatal("Layer %s is not compatible with the core layer which only supports these series: %s (layer is compatible with %s)"

Comments

Richard Purdie Feb. 5, 2019, 3:14 p.m.
On Fri, 2019-01-25 at 15:09 +0800, Robert Yang wrote:
> It shouldn't work when there are duplicated BBFILE_COLLECTIONS.
> 
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  bitbake/lib/bb/cookerdata.py | 4 ++++
>  1 file changed, 4 insertions(+)

This caused a load of failures on yocto-check-layer:

https://autobuilder.yoctoproject.org/typhoon/#/builders/39/builds/259

We may need to fix that behaviour of that script?

Not sure if this is highlighting a bug or not...

Cheers,

Richard
Mark Hatle Feb. 5, 2019, 4:43 p.m.
On 2/5/19 9:14 AM, Richard Purdie wrote:
> On Fri, 2019-01-25 at 15:09 +0800, Robert Yang wrote:
>> It shouldn't work when there are duplicated BBFILE_COLLECTIONS.
>>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> ---
>>  bitbake/lib/bb/cookerdata.py | 4 ++++
>>  1 file changed, 4 insertions(+)
> 
> This caused a load of failures on yocto-check-layer:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/39/builds/259
> 
> We may need to fix that behaviour of that script?
> 
> Not sure if this is highlighting a bug or not...

I think it is highlighting a bug in the yocto-check-layer.

I've seen instances in the past where something has failed (or been aborted),
and the yocto-check-layer didn't cleanup after itself.

Due to this, we had various configuration files load multiple times (since the
layer was loaded multiple times) which caused problems throughout the system.

The yocto-check-layer needs to somehow verify that it's not added the same layer
multiple times.

--Mark

> Cheers,
> 
> Richard
>
Robert Yang Feb. 12, 2019, 2:02 a.m.
On 2/6/19 12:43 AM, Mark Hatle wrote:
> On 2/5/19 9:14 AM, Richard Purdie wrote:
>> On Fri, 2019-01-25 at 15:09 +0800, Robert Yang wrote:
>>> It shouldn't work when there are duplicated BBFILE_COLLECTIONS.
>>>
>>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>>> ---
>>>   bitbake/lib/bb/cookerdata.py | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>
>> This caused a load of failures on yocto-check-layer:
>>
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/39/builds/259
>>
>> We may need to fix that behaviour of that script?
>>
>> Not sure if this is highlighting a bug or not...
> 
> I think it is highlighting a bug in the yocto-check-layer.
> 
> I've seen instances in the past where something has failed (or been aborted),
> and the yocto-check-layer didn't cleanup after itself.
> 
> Due to this, we had various configuration files load multiple times (since the
> layer was loaded multiple times) which caused problems throughout the system.
> 
> The yocto-check-layer needs to somehow verify that it's not added the same layer
> multiple times.

Sorry, I just came back from holiday, I will work on it if it has not been fixed.

// Robert

> 
> --Mark
> 
>> Cheers,
>>
>> Richard
>>
> 
>
Robert Yang Feb. 12, 2019, 10:04 a.m.
On 2/12/19 10:02 AM, Robert Yang wrote:
> 
> 
> On 2/6/19 12:43 AM, Mark Hatle wrote:
>> On 2/5/19 9:14 AM, Richard Purdie wrote:
>>> On Fri, 2019-01-25 at 15:09 +0800, Robert Yang wrote:
>>>> It shouldn't work when there are duplicated BBFILE_COLLECTIONS.
>>>>
>>>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>>>> ---
>>>>   bitbake/lib/bb/cookerdata.py | 4 ++++
>>>>   1 file changed, 4 insertions(+)
>>>
>>> This caused a load of failures on yocto-check-layer:
>>>
>>> https://autobuilder.yoctoproject.org/typhoon/#/builders/39/builds/259
>>>
>>> We may need to fix that behaviour of that script?
>>>
>>> Not sure if this is highlighting a bug or not...
>>
>> I think it is highlighting a bug in the yocto-check-layer.
>>
>> I've seen instances in the past where something has failed (or been aborted),
>> and the yocto-check-layer didn't cleanup after itself.
>>
>> Due to this, we had various configuration files load multiple times (since the
>> layer was loaded multiple times) which caused problems throughout the system.
>>
>> The yocto-check-layer needs to somehow verify that it's not added the same layer
>> multiple times.
> 
> Sorry, I just came back from holiday, I will work on it if it has not been fixed.

I've sent 2 patches in oe-core to fix yocto-check-layer:

http://lists.openembedded.org/pipermail/openembedded-core/2019-February/278919.html

// Robert

> 
> // Robert
> 
>>
>> --Mark
>>
>>> Cheers,
>>>
>>> Richard
>>>
>>
>>