All of lore.kernel.org
 help / color / mirror / Atom feed
* Conditional inherit with PACKAGECONFIG
@ 2020-12-04  4:34 Robert Joslyn
  2020-12-04 11:40 ` [OE-core] " Konrad Weihmann
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Joslyn @ 2020-12-04  4:34 UTC (permalink / raw)
  To: openembedded-core

I'm trying to remove unnecessary packages from one of my images, and I
noticed that some conditional inherit lines don't work as I'd expect. In
my case, I'm trying to remove python, and the only recipe pulling in
python is btrfs-tools. The relevant parts of the btrfs-tools recipe (I'm
building on master):

PACKAGECONFIG ??= "python"

PACKAGECONFIG[python] = "--enable-python,--disable-python,python3-
setuptools-native"

inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'distutils3-base', 
'', d)}

I have a bbappend removing the default PACKAGECONFIG containing "python",
but I still get a btrfs-tools package that RDEPENDS on python because the
distutils3-base class is still inherited. If I modify the btrfs-tools
recipe directly to be:

PACKAGECONFIG ??= ""

then I don't get python as an RDEPENDS. If I have the recipe modified like
this and then try to add python to PACKAGECONFIG from my bbappend, the
recipe fails to build because distutils3-base isn't inherited.

My guess is that the inherit lines are parsed and expanded before the
bbappend modification to PACKAGECONFIG are applied. The bitbake
documentation says you can have conditional inherits similar to this, but
it seems there is more nuance with how the parsing is done. How should
this be done if I want to be able to remove python from this recipe using
a bbappend? I'd prefer to avoid copying the recipe into my layer to make
the changes.

Thanks,
Robert


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] Conditional inherit with PACKAGECONFIG
  2020-12-04  4:34 Conditional inherit with PACKAGECONFIG Robert Joslyn
@ 2020-12-04 11:40 ` Konrad Weihmann
  2020-12-08  4:26   ` Robert Joslyn
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Weihmann @ 2020-12-04 11:40 UTC (permalink / raw)
  To: openembedded-core, robert.joslyn

PACKAGECONFIG_pn-btrfs-utils = "foo bar" in local.conf or distro.conf 
should do what you had in mind.
But yes your observations are correct bbappends are applied *after* the 
initial recipe was parsed

On 04.12.20 05:34, Robert Joslyn wrote:
> I'm trying to remove unnecessary packages from one of my images, and I
> noticed that some conditional inherit lines don't work as I'd expect. In
> my case, I'm trying to remove python, and the only recipe pulling in
> python is btrfs-tools. The relevant parts of the btrfs-tools recipe (I'm
> building on master):
> 
> PACKAGECONFIG ??= "python"
> 
> PACKAGECONFIG[python] = "--enable-python,--disable-python,python3-
> setuptools-native"
> 
> inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'distutils3-base',
> '', d)}
> 
> I have a bbappend removing the default PACKAGECONFIG containing "python",
> but I still get a btrfs-tools package that RDEPENDS on python because the
> distutils3-base class is still inherited. If I modify the btrfs-tools
> recipe directly to be:
> 
> PACKAGECONFIG ??= ""
> 
> then I don't get python as an RDEPENDS. If I have the recipe modified like
> this and then try to add python to PACKAGECONFIG from my bbappend, the
> recipe fails to build because distutils3-base isn't inherited.
> 
> My guess is that the inherit lines are parsed and expanded before the
> bbappend modification to PACKAGECONFIG are applied. The bitbake
> documentation says you can have conditional inherits similar to this, but
> it seems there is more nuance with how the parsing is done. How should
> this be done if I want to be able to remove python from this recipe using
> a bbappend? I'd prefer to avoid copying the recipe into my layer to make
> the changes.
> 
> Thanks,
> Robert
> 
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] Conditional inherit with PACKAGECONFIG
  2020-12-04 11:40 ` [OE-core] " Konrad Weihmann
@ 2020-12-08  4:26   ` Robert Joslyn
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Joslyn @ 2020-12-08  4:26 UTC (permalink / raw)
  To: Konrad Weihmann; +Cc: openembedded-core

On 2020-12-04 03:40, Konrad Weihmann wrote:
> PACKAGECONFIG_pn-btrfs-utils = "foo bar" in local.conf or distro.conf
> should do what you had in mind.
> But yes your observations are correct bbappends are applied *after*
> the initial recipe was parsed

Thanks, I was able to get it working with this in my distro.conf:

PACKAGECONFIG_pn-btrfs-tools = ""
PACKAGECONFIG_pn-btrfs-tools-native = ""

It'd be nice if I could keep it contained within the bbappend, but this 
is better than copying the recipe to my layer.

Thanks,
Robert

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-08  4:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  4:34 Conditional inherit with PACKAGECONFIG Robert Joslyn
2020-12-04 11:40 ` [OE-core] " Konrad Weihmann
2020-12-08  4:26   ` Robert Joslyn

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.