[bitbake-devel] Difference between inclusion and inheritance

Ulf Magnusson ulfalizer at gmail.com
Thu Oct 20 11:12:19 UTC 2016


On Tue, Oct 18, 2016 at 11:50 PM, Davis Roman <davis.roman84 at gmail.com> wrote:
> Hello Bitbake community,
>
> I'm a bitbake newbie and so naturally I'm becoming familiar with the bitbake
> documentation.
>
> I came across something confusing ( well atleast for me ) regarding the
> difference between optional/required Inclusion versus inheritance.
>
> As far as optional/required inclusion is concerned, the documentation states
> quite clearly that the main difference is that the former will not issue an
> error message if the specified file is not found while the latter will so
> there is no issue here.
>
> My issue has to do with the 'inherit' command. Sounds to me like 'include'
> and 'require' already do the trick so I'm curious to know what value does
> 'inherit' bring ?
>
> Any clarification would be extremely appreciated.
>
> Thank you,
>
> Davis

Hello,

One important feature of 'inherit' is that it only includes classes
once, even if they are inherited multiple times.

Say your recipe uses two classes that both in turn use the same helper
class foo.bbclass for example. With 'include'/'require', you'll get
two instances of foo.bbclass, which could break things (appends will
turn into double appends, etc.) With 'inherit', you'll get a single
instance of foo.bbclass.

I'm not sure if this is well documented at the moment. Consider
filling a documentation bug at
https://bugzilla.yoctoproject.org/enter_bug.cgi?classification=Documentation
if it isn't.

Cheers,
Ulf



More information about the bitbake-devel mailing list