[OE-core] [PATCH v2 1/6] yocto-compat-layer.py: avoid adding layers more than once

Mark Hatle mark.hatle at windriver.com
Wed Jun 28 09:06:12 UTC 2017


On 6/28/17 9:50 AM, Patrick Ohly wrote:
> On Tue, 2017-06-27 at 15:46 -0700, Christopher Larson wrote:
>>
>> On Tue, Jun 27, 2017 at 8:33 AM, Patrick Ohly <patrick.ohly at intel.com>
>> wrote:
>>         add_layer_dependencies() might get called more than once, or
>>         one of
>>         the layer dependencies might already be present. The function
>>         should
>>         not add layers again because doing so can cause warnings like:
>>         
>>           WARNING: Duplicate inclusion
>>         for .../meta-openembedded/meta-oe/conf/distro/include/meta_oe_security_flags.inc in .../meta-openembedded/meta-oe/conf/layer.conf
>>         
>>         Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
>>         ---
>>
>> I’m curious about why this isn’t either just calling out to
>> `bitbake-layers add-layer` or using one of the existing functions we
>> have for modifying bblayers, rather than doing its own +=.
> 
> I don't know exactly, Mark implemented it like that. My guess is that
> more control was needed over which layers get added. For example,
> "bitbake-layers add-layer" only adds one layer, but does not recursively
> add layers it depends on. This could be improved of course.
> 

Correct.  Dependencies had to be evaluated for the layers to be added properly.
The existing add-layer does not process dependencies, it simply adds the layer.

The code was also based on the prior version which did it directly and not via
bitbake add-layer.  I did not change that behavior, but simply added the ability
to evaluate the dependency set and include the necessary combinations for the
layer to work properly.

I have no objections to using bitbake-layers add-layer.  (Note, I'm working on
general enhancements that may allow this to process dependencies, but I'm not
sure when I will have that work done.)

--Mark



More information about the Openembedded-core mailing list