All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
@ 2019-04-01 16:01 Andreas Müller
  2019-04-01 16:10 ` Alexander Kanavin
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Müller @ 2019-04-01 16:01 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
V1 -> V2: Introduce GIR_MESON_OPTION as suggested by Alexander Kanavin
 meta/classes/gobject-introspection.bbclass | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/meta/classes/gobject-introspection.bbclass b/meta/classes/gobject-introspection.bbclass
index 4ceb0c68b1..d3c92e0d7a 100644
--- a/meta/classes/gobject-introspection.bbclass
+++ b/meta/classes/gobject-introspection.bbclass
@@ -6,14 +6,26 @@
 # This also sets up autoconf-based recipes to build introspection data (or not),
 # depending on distro and machine features (see gobject-introspection-data class).
 inherit python3native gobject-introspection-data
+
+# meson: default option name to enable/disable introspection. This matches most
+# project's configuration. In doubts - check meson_options.txt in project's
+# source path.
+GIR_MESON_OPTION ?= 'introspection'
+
+# Auto enable/disable based on GI_DATA_ENABLED
 EXTRA_OECONF_prepend_class-target = "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection', '--disable-introspection', d)} "
+EXTRA_OEMESON_prepend_class-target = "-D${GIR_MESON_OPTION}=${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'true', 'false', d)} "
 
 # When building native recipes, disable introspection, as it is not necessary,
 # pulls in additional dependencies, and makes build times longer
 EXTRA_OECONF_prepend_class-native = "--disable-introspection "
 EXTRA_OECONF_prepend_class-nativesdk = "--disable-introspection "
+EXTRA_OEMESON_prepend_class-native = "-D${GIR_MESON_OPTION}=False "
+EXTRA_OEMESON_prepend_class-nativesdk = "-D${GIR_MESON_OPTION}=False "
 
-UNKNOWN_CONFIGURE_WHITELIST_append = " --enable-introspection --disable-introspection"
+# Avoid triggering configure QA
+UNKNOWN_CONFIGURE_WHITELIST_append = " ${@["", "--enable-introspection --disable-introspection"][(bb.data.inherits_class('autotools', d))]}"
+UNKNOWN_CONFIGURE_WHITELIST_append = " ${@["", "${GIR_MESON_OPTION}"][(bb.data.inherits_class('meson', d))]}"
 
 # Generating introspection data depends on a combination of native and target
 # introspection tools, and qemu to run the target tools.
-- 
2.20.1



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

* Re: [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
  2019-04-01 16:01 [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson Andreas Müller
@ 2019-04-01 16:10 ` Alexander Kanavin
  2019-04-01 16:21   ` Alexander Kanavin
  2019-04-01 16:21   ` Andreas Müller
  0 siblings, 2 replies; 11+ messages in thread
From: Alexander Kanavin @ 2019-04-01 16:10 UTC (permalink / raw)
  To: Andreas Müller; +Cc: OE-core

On Mon, 1 Apr 2019 at 18:01, Andreas Müller <schnitzeltony@gmail.com> wrote:
> +# Auto enable/disable based on GI_DATA_ENABLED
>  EXTRA_OECONF_prepend_class-target = "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection', '--disable-introspection', d)} "
> +EXTRA_OEMESON_prepend_class-target = "-D${GIR_MESON_OPTION}=${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'true', 'false', d)} "

Thanks, may I also ask that you go over the recipes in oe-core that
inherit meson, and tweak them to use this option? (there is not a lot,
and some don't use g-i at all).

>  # When building native recipes, disable introspection, as it is not necessary,
>  # pulls in additional dependencies, and makes build times longer
>  EXTRA_OECONF_prepend_class-native = "--disable-introspection "
>  EXTRA_OECONF_prepend_class-nativesdk = "--disable-introspection "
> +EXTRA_OEMESON_prepend_class-native = "-D${GIR_MESON_OPTION}=False "
> +EXTRA_OEMESON_prepend_class-nativesdk = "-D${GIR_MESON_OPTION}=False "
>
> -UNKNOWN_CONFIGURE_WHITELIST_append = " --enable-introspection --disable-introspection"
> +# Avoid triggering configure QA
> +UNKNOWN_CONFIGURE_WHITELIST_append = " ${@["", "--enable-introspection --disable-introspection"][(bb.data.inherits_class('autotools', d))]}"
> +UNKNOWN_CONFIGURE_WHITELIST_append = " ${@["", "${GIR_MESON_OPTION}"][(bb.data.inherits_class('meson', d))]}"

I honestly don't remember why the whitelisting was considered a good
idea, but I think it would be better to drop it altogether? That way
there will be no silent regressions (when upstream decides to rename
the option, for example, which does happen).

Alex


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

* Re: [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
  2019-04-01 16:10 ` Alexander Kanavin
@ 2019-04-01 16:21   ` Alexander Kanavin
  2019-04-01 16:36     ` Andreas Müller
  2019-04-03 10:55     ` Andreas Müller
  2019-04-01 16:21   ` Andreas Müller
  1 sibling, 2 replies; 11+ messages in thread
From: Alexander Kanavin @ 2019-04-01 16:21 UTC (permalink / raw)
  To: Andreas Müller; +Cc: OE-core

On Mon, 1 Apr 2019 at 18:10, Alexander Kanavin <alex.kanavin@gmail.com> wrote:

> Thanks, may I also ask that you go over the recipes in oe-core that
> inherit meson, and tweak them to use this option? (there is not a lot,
> and some don't use g-i at all).

The exact list is:

at-spi2-core
libsoup-2.4
gdk-pixbuf
libmodulemd
atk
pango
libdazzle
json-glib
clutter-gtk-1.0.inc

Alex


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

* Re: [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
  2019-04-01 16:10 ` Alexander Kanavin
  2019-04-01 16:21   ` Alexander Kanavin
@ 2019-04-01 16:21   ` Andreas Müller
  2019-04-01 16:36     ` Alexander Kanavin
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Müller @ 2019-04-01 16:21 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

On Mon, Apr 1, 2019 at 6:10 PM Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> On Mon, 1 Apr 2019 at 18:01, Andreas Müller <schnitzeltony@gmail.com> wrote:
> > +# Auto enable/disable based on GI_DATA_ENABLED
> >  EXTRA_OECONF_prepend_class-target = "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection', '--disable-introspection', d)} "
> > +EXTRA_OEMESON_prepend_class-target = "-D${GIR_MESON_OPTION}=${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'true', 'false', d)} "
>
> Thanks, may I also ask that you go over the recipes in oe-core that
> inherit meson, and tweak them to use this option? (there is not a lot,
> and some don't use g-i at all).
OK will do - but I'll wait a bit just in case somebody finds reasons
not to apply this patch.
>
> >  # When building native recipes, disable introspection, as it is not necessary,
> >  # pulls in additional dependencies, and makes build times longer
> >  EXTRA_OECONF_prepend_class-native = "--disable-introspection "
> >  EXTRA_OECONF_prepend_class-nativesdk = "--disable-introspection "
> > +EXTRA_OEMESON_prepend_class-native = "-D${GIR_MESON_OPTION}=False "
> > +EXTRA_OEMESON_prepend_class-nativesdk = "-D${GIR_MESON_OPTION}=False "
> >
> > -UNKNOWN_CONFIGURE_WHITELIST_append = " --enable-introspection --disable-introspection"
> > +# Avoid triggering configure QA
> > +UNKNOWN_CONFIGURE_WHITELIST_append = " ${@["", "--enable-introspection --disable-introspection"][(bb.data.inherits_class('autotools', d))]}"
> > +UNKNOWN_CONFIGURE_WHITELIST_append = " ${@["", "${GIR_MESON_OPTION}"][(bb.data.inherits_class('meson', d))]}"
>
> I honestly don't remember why the whitelisting was considered a good
> idea, but I think it would be better to drop it altogether? That way
> there will be no silent regressions (when upstream decides to rename
> the option, for example, which does happen).
>
Whitelisting would make sense for for projects where gir is mandatory
and cannot be disabled by configuration - are there any?

And


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

* Re: [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
  2019-04-01 16:21   ` Alexander Kanavin
@ 2019-04-01 16:36     ` Andreas Müller
  2019-04-03 10:55     ` Andreas Müller
  1 sibling, 0 replies; 11+ messages in thread
From: Andreas Müller @ 2019-04-01 16:36 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

On Mon, Apr 1, 2019 at 6:21 PM Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> On Mon, 1 Apr 2019 at 18:10, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> > Thanks, may I also ask that you go over the recipes in oe-core that
> > inherit meson, and tweak them to use this option? (there is not a lot,
> > and some don't use g-i at all).
>
> The exact list is:
>
> at-spi2-core
> libsoup-2.4
> gdk-pixbuf
> libmodulemd
> atk
> pango
> libdazzle
> json-glib
> clutter-gtk-1.0.inc
>
> Alex

Thanks :)

I cannot promise when but will take care because I consider it an enhancement.

Problem is that I am sitting on growing loads of meta-gnome patches
and they need review for this either.

As collector of DEs I'd love to see gnome again - that should have
been next step in [1]

[1] https://github.com/schnitzeltony/meta-openembedded/tree/work-2019-03

Andreas


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

* Re: [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
  2019-04-01 16:21   ` Andreas Müller
@ 2019-04-01 16:36     ` Alexander Kanavin
  2019-04-01 19:26       ` Andreas Müller
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Kanavin @ 2019-04-01 16:36 UTC (permalink / raw)
  To: Andreas Müller; +Cc: OE-core

On Mon, 1 Apr 2019 at 18:21, Andreas Müller <schnitzeltony@gmail.com> wrote:

> > I honestly don't remember why the whitelisting was considered a good
> > idea, but I think it would be better to drop it altogether? That way
> > there will be no silent regressions (when upstream decides to rename
> > the option, for example, which does happen).
> >
> Whitelisting would make sense for for projects where gir is mandatory
> and cannot be disabled by configuration - are there any?

For autotools, basically no, as they all use the same m4 macro file
which allows disabling.

For meson or other build systems the answer is also no, because in
this case we would have to patch the upstream code to either make gir
generation optional (and then 'inherit gobject-introspection'), or
disable it altogether (and then don't inherit g-i at all). The reason
is that introspection data generation is done through running a target
binary, which requires a functional qemu usermode, and for some target
MACHINEs qemu won't work (e.g. mips-n32, some flavours of powerpc etc
- g-i class determines that and does the right thing to disable
introspection automatically). Here's an example of such patching:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/libmodulemd/libmodulemd/0002-modulemd-v1-meson.build-do-not-generate-gir-or-gtkdo.patch?id=f06d14b2963e9d5145041057c3ad0e48654f1501

(newer versions of libmodulemd made g-i optional, and so the current
oe-core recipe and its patches reflects that).

Alex


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

* Re: [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
  2019-04-01 16:36     ` Alexander Kanavin
@ 2019-04-01 19:26       ` Andreas Müller
  2019-04-01 19:34         ` Alexander Kanavin
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Müller @ 2019-04-01 19:26 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

On Mon, Apr 1, 2019 at 6:36 PM Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> On Mon, 1 Apr 2019 at 18:21, Andreas Müller <schnitzeltony@gmail.com> wrote:
>
> > > I honestly don't remember why the whitelisting was considered a good
> > > idea, but I think it would be better to drop it altogether? That way
> > > there will be no silent regressions (when upstream decides to rename
> > > the option, for example, which does happen).
> > >
> > Whitelisting would make sense for for projects where gir is mandatory
> > and cannot be disabled by configuration - are there any?
>
> For autotools, basically no, as they all use the same m4 macro file
> which allows disabling.
>
> For meson or other build systems the answer is also no, because in
> this case we would have to patch the upstream code to either make gir
> generation optional (and then 'inherit gobject-introspection'), or
> disable it altogether (and then don't inherit g-i at all). The reason
> is that introspection data generation is done through running a target
> binary, which requires a functional qemu usermode, and for some target
> MACHINEs qemu won't work (e.g. mips-n32, some flavours of powerpc etc
> - g-i class determines that and does the right thing to disable
> introspection automatically).
What about musl? Am not sure that my information is still valid:
Broken qemu or not?
> Here's an example of such patching:
>
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/libmodulemd/libmodulemd/0002-modulemd-v1-meson.build-do-not-generate-gir-or-gtkdo.patch?id=f06d14b2963e9d5145041057c3ad0e48654f1501
>
> (newer versions of libmodulemd made g-i optional, and so the current
> oe-core recipe and its patches reflects that).
>
I will prepare follow ups:

* remove whitelisting (see what we get)
* adapt recipes in oe-core

Seems all this is too late for warrier (that was my target - am again
too late - maybe next time :).

So I think I'll continue with gnome-de for warrier first (with oe-core
as is). Maybe I get patches landed before doors are shut for
meta-gnome...

Will come back then

Andreas


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

* Re: [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
  2019-04-01 19:26       ` Andreas Müller
@ 2019-04-01 19:34         ` Alexander Kanavin
  2019-04-01 20:41           ` Andreas Müller
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Kanavin @ 2019-04-01 19:34 UTC (permalink / raw)
  To: Andreas Müller; +Cc: OE-core

On Mon, 1 Apr 2019 at 21:26, Andreas Müller <schnitzeltony@gmail.com> wrote:
> What about musl? Am not sure that my information is still valid:
> Broken qemu or not?

musl is fine with qemu.

Alex


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

* Re: [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
  2019-04-01 19:34         ` Alexander Kanavin
@ 2019-04-01 20:41           ` Andreas Müller
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas Müller @ 2019-04-01 20:41 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

On Mon, Apr 1, 2019 at 9:34 PM Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> On Mon, 1 Apr 2019 at 21:26, Andreas Müller <schnitzeltony@gmail.com> wrote:
> > What about musl? Am not sure that my information is still valid:
> > Broken qemu or not?
>
> musl is fine with qemu.
>
Just saw glib-networking failing for 'gnutils' option -> yes this
option is not available.

The very first I have to do is fixing fallout by unrecognised meson
options - hurray it seems to work - damn it causes more extra efforts
:(

Andreas


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

* Re: [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
  2019-04-01 16:21   ` Alexander Kanavin
  2019-04-01 16:36     ` Andreas Müller
@ 2019-04-03 10:55     ` Andreas Müller
  2019-04-03 11:48       ` Alexander Kanavin
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Müller @ 2019-04-03 10:55 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

On Mon, Apr 1, 2019 at 6:21 PM Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> On Mon, 1 Apr 2019 at 18:10, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> > Thanks, may I also ask that you go over the recipes in oe-core that
> > inherit meson, and tweak them to use this option? (there is not a lot,
> > and some don't use g-i at all).
>
> The exact list is:
>
> at-spi2-core
> libsoup-2.4
> gdk-pixbuf
> libmodulemd
> atk
> pango
> libdazzle
> json-glib
> clutter-gtk-1.0.inc
>
> Alex
Some intermediate info:

* adjusted gobject-introspection.bbclass to make flags (true/false or
yes/no ...) overridable and removed configure option whitelisting
* changed the recipes above
* update glib-networking to get gnutls option back

With test builds I get:
* gstreamer1.0-plugins-good complains for unrecognised
'enable-introspection' and 'disable-introspection'. This is odd for
two reasons: Both options enable/disable? gstreamer1.0-plugins-good
complains but has introspection.m4 what is the problem?
* Some recipes in meta-gnome complain for unrecognised options now

To be continued...

Andreas


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

* Re: [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson
  2019-04-03 10:55     ` Andreas Müller
@ 2019-04-03 11:48       ` Alexander Kanavin
  0 siblings, 0 replies; 11+ messages in thread
From: Alexander Kanavin @ 2019-04-03 11:48 UTC (permalink / raw)
  To: Andreas Müller; +Cc: OE-core

On Wed, 3 Apr 2019 at 12:55, Andreas Müller <schnitzeltony@gmail.com> wrote:
t builds I get:
> * gstreamer1.0-plugins-good complains for unrecognised
> 'enable-introspection' and 'disable-introspection'. This is odd for
> two reasons: Both options enable/disable? gstreamer1.0-plugins-good
> complains but has introspection.m4 what is the problem?

It seems as though gst-plugins-good does not support introspection,
and never did! So you can simply add the option whitelisting to that
recipe specifically.

Alex


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

end of thread, other threads:[~2019-04-03 11:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-01 16:01 [PATCH 2/2 V2] gobject-introspection: auto-enable/-disable gobject-introspection for meson Andreas Müller
2019-04-01 16:10 ` Alexander Kanavin
2019-04-01 16:21   ` Alexander Kanavin
2019-04-01 16:36     ` Andreas Müller
2019-04-03 10:55     ` Andreas Müller
2019-04-03 11:48       ` Alexander Kanavin
2019-04-01 16:21   ` Andreas Müller
2019-04-01 16:36     ` Alexander Kanavin
2019-04-01 19:26       ` Andreas Müller
2019-04-01 19:34         ` Alexander Kanavin
2019-04-01 20:41           ` Andreas Müller

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.