Re: [PATCH 0/2] Yocto Compatible 2.0 support code

Joshua Watt
2017-06-07T15:43:04Z

On Wed, 2017-06-07 at 17:31 +0200, Patrick Ohly wrote:
> As discussed in the "[Openembedded-architecture] Yocto Compatible 2.0
> + signature changes" mail thread, changes in a .bbappend cannot be
> done unconditionally. Making _append and _remove depend on overrides
> which get set based on DISTRO_FEATURES is one way of achieving this.
>
> The oe.utils.optional_includes() helper function has not been
> discussed before. It's an attempt to address concerns by developers
> that having to write code for (potentially complex) condition
> checking
> is error prone and hard to read.

I promise I'm not trying to start a flame war here, and perhaps there
is history behind this that I'm not aware of but...

Why doesn't bitbake support some sort of "if" statement? It seems like
most of what we are trying to do could be accomplished with much less
fuss if one could simply do this in the bb file:

if bb.utils.contains('DISTRO_FEATURES', 'my-feature', d):
include foo.inc

One could even eliminate the separate inc file and simply put its
contents under the conditional (as much fun as it seems to have to open
a new file just to see what a recipe is doing with a distro feature...)

It would also appear that this could make a lot of other things simpler
as well (and may even negate the need to backfill DISTRO_FEATURES into
overrides?)

>
> It depends on the bitbake enhancement that allows including multiple
> files at once.
>
> Patrick Ohly (2):
>   bitbake.conf: DISTRO_FEATURES as overrides
>   utils.py: helper function for optional include files
>
>  meta/conf/bitbake.conf | 17 ++++++++++++++++-
>  meta/lib/oe/utils.py   | 29 +++++++++++++++++++++++++++++
>  2 files changed, 45 insertions(+), 1 deletion(-)
>
> base-commit: 49c255494c1d0704a1c8c428281c81541b05dc3e
> --
> git-series 0.9.1