* Difference between bitbake inclusion and inheritance
@ 2016-10-18 22:37 Davis Roman
2016-10-19 0:44 ` Khem Raj
2016-10-19 2:00 ` Paul Eggleton
0 siblings, 2 replies; 4+ messages in thread
From: Davis Roman @ 2016-10-18 22:37 UTC (permalink / raw)
To: yocto
[-- Attachment #1: Type: text/plain, Size: 738 bytes --]
Hello,
I'm a yocto newbie and so I'm becoming familiar with the documentation.
I came across a bitbake feature that is somewhat confusing to 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
[-- Attachment #2: Type: text/html, Size: 1943 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Difference between bitbake inclusion and inheritance
2016-10-18 22:37 Difference between bitbake inclusion and inheritance Davis Roman
@ 2016-10-19 0:44 ` Khem Raj
2016-10-19 2:00 ` Paul Eggleton
1 sibling, 0 replies; 4+ messages in thread
From: Khem Raj @ 2016-10-19 0:44 UTC (permalink / raw)
To: Davis Roman; +Cc: yocto
On Tue, Oct 18, 2016 at 3:37 PM, Davis Roman <davis.roman84@gmail.com> wrote:
> Hello,
>
> I'm a yocto newbie and so I'm becoming familiar with the documentation.
>
> I came across a bitbake feature that is somewhat confusing to 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 ?
you can override pretty much everything from an inherited class if you wish to
>
> Any clarification would be extremely appreciated.
>
> Thank you,
>
> Davis
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Difference between bitbake inclusion and inheritance
2016-10-18 22:37 Difference between bitbake inclusion and inheritance Davis Roman
2016-10-19 0:44 ` Khem Raj
@ 2016-10-19 2:00 ` Paul Eggleton
2016-10-19 3:15 ` Davis Roman
1 sibling, 1 reply; 4+ messages in thread
From: Paul Eggleton @ 2016-10-19 2:00 UTC (permalink / raw)
To: Davis Roman; +Cc: yocto
Hi Davis,
On Tue, 18 Oct 2016 18:37:50 Davis Roman wrote:
> I'm a yocto newbie and so I'm becoming familiar with the documentation.
>
> I came across a bitbake feature that is somewhat confusing to 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 ?
The answer is that they are very similar - but tend to be used for slightly
different purposes. inherit is for where you have some functionality that you
expect to be applicable across a number of recipes, so it should show up in a
standard location in a reasonably standard format. The technical differences
really stem from that:
* Classes must appear in a classes subdirectory somewhere along BBPATH
* Classes must be named <something>.bbclass
* Classes can use EXPORT_FUNCTIONS so you can still call the original function
from your overridden version
* It's easy to query from python code whether a recipe inherits a class (and
it's something we do in quite a number of places); it's technically possible
to do the same for include/require but more difficult
include/require are much more generic and applicable for any other kind of
shared or encapsulated functionality or configuration that doesn't suit a
.bbclass.
Note that not all classes are typically inherited from individual recipes with
inherit - there are classes that are usually applied globally by adding their
names to INHERIT (e.g. buildhistory).
Hope that helps.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Difference between bitbake inclusion and inheritance
2016-10-19 2:00 ` Paul Eggleton
@ 2016-10-19 3:15 ` Davis Roman
0 siblings, 0 replies; 4+ messages in thread
From: Davis Roman @ 2016-10-19 3:15 UTC (permalink / raw)
To: Paul Eggleton; +Cc: yocto
[-- Attachment #1: Type: text/plain, Size: 2277 bytes --]
Hi Khem, Paul
I understand now.
Thank you both for your answers!
- Davis
On Tue, Oct 18, 2016 at 10:00 PM, Paul Eggleton <
paul.eggleton@linux.intel.com> wrote:
> Hi Davis,
>
> On Tue, 18 Oct 2016 18:37:50 Davis Roman wrote:
> > I'm a yocto newbie and so I'm becoming familiar with the documentation.
> >
> > I came across a bitbake feature that is somewhat confusing to 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 ?
>
> The answer is that they are very similar - but tend to be used for slightly
> different purposes. inherit is for where you have some functionality that
> you
> expect to be applicable across a number of recipes, so it should show up
> in a
> standard location in a reasonably standard format. The technical
> differences
> really stem from that:
>
> * Classes must appear in a classes subdirectory somewhere along BBPATH
> * Classes must be named <something>.bbclass
> * Classes can use EXPORT_FUNCTIONS so you can still call the original
> function
> from your overridden version
> * It's easy to query from python code whether a recipe inherits a class
> (and
> it's something we do in quite a number of places); it's technically
> possible
> to do the same for include/require but more difficult
>
> include/require are much more generic and applicable for any other kind of
> shared or encapsulated functionality or configuration that doesn't suit a
> .bbclass.
>
> Note that not all classes are typically inherited from individual recipes
> with
> inherit - there are classes that are usually applied globally by adding
> their
> names to INHERIT (e.g. buildhistory).
>
> Hope that helps.
>
> Cheers,
> Paul
>
> --
>
> Paul Eggleton
> Intel Open Source Technology Centre
>
[-- Attachment #2: Type: text/html, Size: 3082 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-19 3:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-18 22:37 Difference between bitbake inclusion and inheritance Davis Roman
2016-10-19 0:44 ` Khem Raj
2016-10-19 2:00 ` Paul Eggleton
2016-10-19 3:15 ` Davis Roman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.