All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] libgpiod: Enable python3 in default packageconfig
@ 2019-08-28  1:14 Khem Raj
  2019-08-28  5:22 ` Adrian Bunk
  0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2019-08-28  1:14 UTC (permalink / raw)
  To: openembedded-devel

this recipe inherits python3native class conditionally, this condition
depends on a given packageconfig, however inherit ${VAR} syntax requires
VAR to be evaluated before inheriting it, therefore if someone appends
python3 to packageconfig via a bbappend, then the packageconfig will
become effective and add --enable-bindings-python to configure but
inherit wont evaluate correctly since the expression adding to
packageconfig

PACKAGECONFIG_append = " python3"

will be coming _after_ the inherit, and the builds will fail e.g.

| ../../../libgpiod-1.3/bindings/python/gpiodmodule.c:8:10: fatal error: Python.h: No such file or directory
|  #include <Python.h>

This patch inverts the logic, meaning if someone has to disable python3
bindings should write a bbappend e.g.

PACKAGECONFIG_remove = "python3"

This will still mean that python3native will be inherited but the
effective configure option will be --disable-bindings-python and that
will do the right thing

See. https://github.com/openembedded/meta-openembedded/issues/140

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-oe/recipes-support/libgpiod/libgpiod_1.4.1.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.4.1.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.4.1.bb
index 756b143ef7..ea1e49129b 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_1.4.1.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.4.1.bb
@@ -6,7 +6,7 @@ SRC_URI[md5sum] = "585b4bb431f99c4ba9b3ee58b9d494c1"
 SRC_URI[sha256sum] = "21ae8fd1f8dafc2eb2ba50e652390cf533d21351419a7426255895cb52e21b1c"
 
 # enable tools and cxx bindings
-PACKAGECONFIG ?= "cxx tools"
+PACKAGECONFIG ?= "cxx tools python3"
 
 PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx"
 PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev"
-- 
2.23.0



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

* Re: [meta-oe][PATCH] libgpiod: Enable python3 in default packageconfig
  2019-08-28  1:14 [meta-oe][PATCH] libgpiod: Enable python3 in default packageconfig Khem Raj
@ 2019-08-28  5:22 ` Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2019-08-28  5:22 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-devel

On Tue, Aug 27, 2019 at 06:14:36PM -0700, Khem Raj wrote:
> this recipe inherits python3native class conditionally, this condition
> depends on a given packageconfig, however inherit ${VAR} syntax requires
> VAR to be evaluated before inheriting it, therefore if someone appends
> python3 to packageconfig via a bbappend, then the packageconfig will
> become effective and add --enable-bindings-python to configure but
> inherit wont evaluate correctly since the expression adding to
> packageconfig
> 
> PACKAGECONFIG_append = " python3"
> 
> will be coming _after_ the inherit, and the builds will fail e.g.
> 
> | ../../../libgpiod-1.3/bindings/python/gpiodmodule.c:8:10: fatal error: Python.h: No such file or directory
> |  #include <Python.h>
> 
> This patch inverts the logic, meaning if someone has to disable python3
> bindings should write a bbappend e.g.
> 
> PACKAGECONFIG_remove = "python3"
> 
> This will still mean that python3native will be inherited but the
> effective configure option will be --disable-bindings-python and that
> will do the right thing
>...
>  # enable tools and cxx bindings
> -PACKAGECONFIG ?= "cxx tools"
> +PACKAGECONFIG ?= "cxx tools python3"
>...

It looks very fragile to me when a PACKAGECONFIG has this kind of 
unexpected side effects.

If I understand it correctly, for solving the problem you want 
python3native always inherited. And the simple way to do this would
be to make the inherit unconditionally without touching PACKAGECONFIG.

Anything I miss here?

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed



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

end of thread, other threads:[~2019-08-28  5:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-28  1:14 [meta-oe][PATCH] libgpiod: Enable python3 in default packageconfig Khem Raj
2019-08-28  5:22 ` Adrian Bunk

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.