diff mbox series

[meta-oe] libgpiod_2.2: depend on glib-2.0

Message ID 20241028112450.2793248-1-max.oss.09@gmail.com
State Accepted
Headers show
Series [meta-oe] libgpiod_2.2: depend on glib-2.0 | expand

Commit Message

Max Krummenacher Oct. 28, 2024, 11:24 a.m. UTC
From: Max Krummenacher <max.krummenacher@toradex.com>

In my setup a build fails with

| checking for gobject-introspection... configure: error: gobject-introspection-1.0 is not installed
| NOTE: The following config.log files may provide further information.
| NOTE: /var/home/krm/build/oe-core_master/build/tmp/work/cortexa55-tdx-linux/libgpiod/2.2/build/config.log
| ERROR: configure failed

From config.log this seems to be related to glib-2.0 not found:

| configure:22484: $PKG_CONFIG --exists --print-errors "gobject-introspection-1.0"
| Package glib-2.0 was not found in the pkg-config search path.
| Perhaps you should add the directory containing `glib-2.0.pc'
| to the PKG_CONFIG_PATH environment variable
| Package 'glib-2.0', required by 'gobject-introspection-1.0', not found
| configure:22487: $? = 1
| configure:22491: error: gobject-introspection-1.0 is not installed

Note that glib-2.0.pc is present in recipes-sysroot-native but not
in recipes-sysroot.

Adding glib-2.0 to depends allows successful build of libgpiod 2.

Fixes: 117d09ce43c7 ("libgpiod: update to v2.2")
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
 meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb | 2 ++
 1 file changed, 2 insertions(+)

I'm unsure if that is the correct fix.
I would have expected that if gobject-introspection-1.0.pc depends
on glib-2.0 to be present, then the inherit of gobject-introspection
would have done the needful.
However I'm not really familiar with gobject-introspection in the
first place.

Max

Comments

Bartosz Golaszewski Oct. 28, 2024, 7:21 p.m. UTC | #1
On Mon, Oct 28, 2024 at 12:26 PM Max Krummenacher via
lists.openembedded.org <max.oss.09=gmail.com@lists.openembedded.org>
wrote:
>
> From: Max Krummenacher <max.krummenacher@toradex.com>
>
> In my setup a build fails with
>
> | checking for gobject-introspection... configure: error: gobject-introspection-1.0 is not installed
> | NOTE: The following config.log files may provide further information.
> | NOTE: /var/home/krm/build/oe-core_master/build/tmp/work/cortexa55-tdx-linux/libgpiod/2.2/build/config.log
> | ERROR: configure failed
>
> From config.log this seems to be related to glib-2.0 not found:
>
> | configure:22484: $PKG_CONFIG --exists --print-errors "gobject-introspection-1.0"
> | Package glib-2.0 was not found in the pkg-config search path.
> | Perhaps you should add the directory containing `glib-2.0.pc'
> | to the PKG_CONFIG_PATH environment variable
> | Package 'glib-2.0', required by 'gobject-introspection-1.0', not found
> | configure:22487: $? = 1
> | configure:22491: error: gobject-introspection-1.0 is not installed
>
> Note that glib-2.0.pc is present in recipes-sysroot-native but not
> in recipes-sysroot.
>
> Adding glib-2.0 to depends allows successful build of libgpiod 2.
>
> Fixes: 117d09ce43c7 ("libgpiod: update to v2.2")
> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> ---
>  meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb | 2 ++
>  1 file changed, 2 insertions(+)
>
> I'm unsure if that is the correct fix.
> I would have expected that if gobject-introspection-1.0.pc depends
> on glib-2.0 to be present, then the inherit of gobject-introspection
> would have done the needful.
> However I'm not really familiar with gobject-introspection in the
> first place.
>
> Max
>
> diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> index b55da72f7b7f..3d9758e27af7 100644
> --- a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> @@ -9,6 +9,8 @@ LIC_FILES_CHKSUM = " \
>      file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
>  "
>
> +DEPENDS += "glib-2.0"
> +

Pulling in the entire GLib for everything in this recipe is definitely
a wrong answer. I'm travelling and have limited time right now but I
will take a look on Thursday or Friday. I did test disabling
introspection though so I'm surprised to see this.

Bart

>  FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
>
>  SRC_URI += "file://gpio-manager.init"
> --
> 2.42.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#113260): https://lists.openembedded.org/g/openembedded-devel/message/113260
> Mute This Topic: https://lists.openembedded.org/mt/109255084/3618139
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [brgl@bgdev.pl]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Khem Raj Oct. 30, 2024, 1:31 a.m. UTC | #2
Bart,

On Mon, Oct 28, 2024 at 12:21 PM Bartosz Golaszewski via
lists.openembedded.org <brgl=bgdev.pl@lists.openembedded.org> wrote:
>
> On Mon, Oct 28, 2024 at 12:26 PM Max Krummenacher via
> lists.openembedded.org <max.oss.09=gmail.com@lists.openembedded.org>
> wrote:
> >
> > From: Max Krummenacher <max.krummenacher@toradex.com>
> >
> > In my setup a build fails with
> >
> > | checking for gobject-introspection... configure: error: gobject-introspection-1.0 is not installed
> > | NOTE: The following config.log files may provide further information.
> > | NOTE: /var/home/krm/build/oe-core_master/build/tmp/work/cortexa55-tdx-linux/libgpiod/2.2/build/config.log
> > | ERROR: configure failed
> >
> > From config.log this seems to be related to glib-2.0 not found:
> >
> > | configure:22484: $PKG_CONFIG --exists --print-errors "gobject-introspection-1.0"
> > | Package glib-2.0 was not found in the pkg-config search path.
> > | Perhaps you should add the directory containing `glib-2.0.pc'
> > | to the PKG_CONFIG_PATH environment variable
> > | Package 'glib-2.0', required by 'gobject-introspection-1.0', not found
> > | configure:22487: $? = 1
> > | configure:22491: error: gobject-introspection-1.0 is not installed
> >
> > Note that glib-2.0.pc is present in recipes-sysroot-native but not
> > in recipes-sysroot.
> >
> > Adding glib-2.0 to depends allows successful build of libgpiod 2.
> >
> > Fixes: 117d09ce43c7 ("libgpiod: update to v2.2")
> > Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> > ---
> >  meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > I'm unsure if that is the correct fix.
> > I would have expected that if gobject-introspection-1.0.pc depends
> > on glib-2.0 to be present, then the inherit of gobject-introspection
> > would have done the needful.
> > However I'm not really familiar with gobject-introspection in the
> > first place.
> >
> > Max
> >
> > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> > index b55da72f7b7f..3d9758e27af7 100644
> > --- a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> > @@ -9,6 +9,8 @@ LIC_FILES_CHKSUM = " \
> >      file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
> >  "
> >
> > +DEPENDS += "glib-2.0"
> > +
>
> Pulling in the entire GLib for everything in this recipe is definitely
> a wrong answer. I'm travelling and have limited time right now but I
> will take a look on Thursday or Friday. I did test disabling
> introspection though so I'm surprised to see this.
>

There is a problem with this when --enable-introspection is used
without ptests being in distro features
the reason it works with ptests on is that it enables 'test'
packageconfig which brings in glib-2.0 dependency
however if we build without 'ptest' DISTRO_FEATURE it will fail to
configure like below

   configure:22490: checking for gobject-introspection
   configure:22499: $PKG_CONFIG --exists --print-errors
"gobject-introspection-1.0"
   Package glib-2.0 was not found in the pkg-config search path.
   Perhaps you should add the directory containing `glib-2.0.pc'
   to the PKG_CONFIG_PATH environment variable
   Package 'glib-2.0', required by 'gobject-introspection-1.0', not found
   configure:22502: $? = 1
   configure:22506: error: gobject-introspection-1.0 is not installed

The check inconfigure,ac is using GOBJECT_INTROSPECTION_CHECK macro
which is expanding to this
check I guess.

It seems that glib-2.0 is a hard dep for gobject-introspection so it
might be better to add it in bbclass itself.

> Bart
>
> >  FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
> >
> >  SRC_URI += "file://gpio-manager.init"
> > --
> > 2.42.0
> >
> >
> >
> >
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#113265): https://lists.openembedded.org/g/openembedded-devel/message/113265
> Mute This Topic: https://lists.openembedded.org/mt/109255084/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Khem Raj Oct. 30, 2024, 1:33 a.m. UTC | #3
On Tue, Oct 29, 2024 at 6:31 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> Bart,
>
> On Mon, Oct 28, 2024 at 12:21 PM Bartosz Golaszewski via
> lists.openembedded.org <brgl=bgdev.pl@lists.openembedded.org> wrote:
> >
> > On Mon, Oct 28, 2024 at 12:26 PM Max Krummenacher via
> > lists.openembedded.org <max.oss.09=gmail.com@lists.openembedded.org>
> > wrote:
> > >
> > > From: Max Krummenacher <max.krummenacher@toradex.com>
> > >
> > > In my setup a build fails with
> > >
> > > | checking for gobject-introspection... configure: error: gobject-introspection-1.0 is not installed
> > > | NOTE: The following config.log files may provide further information.
> > > | NOTE: /var/home/krm/build/oe-core_master/build/tmp/work/cortexa55-tdx-linux/libgpiod/2.2/build/config.log
> > > | ERROR: configure failed
> > >
> > > From config.log this seems to be related to glib-2.0 not found:
> > >
> > > | configure:22484: $PKG_CONFIG --exists --print-errors "gobject-introspection-1.0"
> > > | Package glib-2.0 was not found in the pkg-config search path.
> > > | Perhaps you should add the directory containing `glib-2.0.pc'
> > > | to the PKG_CONFIG_PATH environment variable
> > > | Package 'glib-2.0', required by 'gobject-introspection-1.0', not found
> > > | configure:22487: $? = 1
> > > | configure:22491: error: gobject-introspection-1.0 is not installed
> > >
> > > Note that glib-2.0.pc is present in recipes-sysroot-native but not
> > > in recipes-sysroot.
> > >
> > > Adding glib-2.0 to depends allows successful build of libgpiod 2.
> > >
> > > Fixes: 117d09ce43c7 ("libgpiod: update to v2.2")
> > > Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> > > ---
> > >  meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > I'm unsure if that is the correct fix.
> > > I would have expected that if gobject-introspection-1.0.pc depends
> > > on glib-2.0 to be present, then the inherit of gobject-introspection
> > > would have done the needful.
> > > However I'm not really familiar with gobject-introspection in the
> > > first place.
> > >
> > > Max
> > >
> > > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> > > index b55da72f7b7f..3d9758e27af7 100644
> > > --- a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> > > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> > > @@ -9,6 +9,8 @@ LIC_FILES_CHKSUM = " \
> > >      file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
> > >  "
> > >
> > > +DEPENDS += "glib-2.0"
> > > +
> >
> > Pulling in the entire GLib for everything in this recipe is definitely
> > a wrong answer. I'm travelling and have limited time right now but I
> > will take a look on Thursday or Friday. I did test disabling
> > introspection though so I'm surprised to see this.
> >
>
> There is a problem with this when --enable-introspection is used
> without ptests being in distro features
> the reason it works with ptests on is that it enables 'test'
> packageconfig which brings in glib-2.0 dependency
> however if we build without 'ptest' DISTRO_FEATURE it will fail to
> configure like below
>
>    configure:22490: checking for gobject-introspection
>    configure:22499: $PKG_CONFIG --exists --print-errors
> "gobject-introspection-1.0"
>    Package glib-2.0 was not found in the pkg-config search path.
>    Perhaps you should add the directory containing `glib-2.0.pc'
>    to the PKG_CONFIG_PATH environment variable
>    Package 'glib-2.0', required by 'gobject-introspection-1.0', not found
>    configure:22502: $? = 1
>    configure:22506: error: gobject-introspection-1.0 is not installed
>
> The check inconfigure,ac is using GOBJECT_INTROSPECTION_CHECK macro
> which is expanding to this
> check I guess.
>
> It seems that glib-2.0 is a hard dep for gobject-introspection so it
> might be better to add it in bbclass itself.

Forgot to mention that I will apply this patch since some devs have
reported this so they can keep chugging
along, we can unbolt it when we have a proper fix.

>
> > Bart
> >
> > >  FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
> > >
> > >  SRC_URI += "file://gpio-manager.init"
> > > --
> > > 2.42.0
> > >
> > >
> > >
> > >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#113265): https://lists.openembedded.org/g/openembedded-devel/message/113265
> > Mute This Topic: https://lists.openembedded.org/mt/109255084/1997914
> > Group Owner: openembedded-devel+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
Max Krummenacher Oct. 30, 2024, 9:28 a.m. UTC | #4
Hello Bart

On Tue, Oct 29, 2024 at 06:33:12PM -0700, Khem Raj wrote:
> On Tue, Oct 29, 2024 at 6:31 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > Bart,
> >
> > On Mon, Oct 28, 2024 at 12:21 PM Bartosz Golaszewski via
> > lists.openembedded.org <brgl=bgdev.pl@lists.openembedded.org> wrote:
> > >
> > > On Mon, Oct 28, 2024 at 12:26 PM Max Krummenacher via
> > > lists.openembedded.org <max.oss.09=gmail.com@lists.openembedded.org>
> > > wrote:
> > > >
> > > > From: Max Krummenacher <max.krummenacher@toradex.com>
> > > >
> > > > In my setup a build fails with
> > > >
> > > > | checking for gobject-introspection... configure: error: gobject-introspection-1.0 is not installed
> > > > | NOTE: The following config.log files may provide further information.
> > > > | NOTE: /var/home/krm/build/oe-core_master/build/tmp/work/cortexa55-tdx-linux/libgpiod/2.2/build/config.log
> > > > | ERROR: configure failed
> > > >
> > > > From config.log this seems to be related to glib-2.0 not found:
> > > >
> > > > | configure:22484: $PKG_CONFIG --exists --print-errors "gobject-introspection-1.0"
> > > > | Package glib-2.0 was not found in the pkg-config search path.
> > > > | Perhaps you should add the directory containing `glib-2.0.pc'
> > > > | to the PKG_CONFIG_PATH environment variable
> > > > | Package 'glib-2.0', required by 'gobject-introspection-1.0', not found
> > > > | configure:22487: $? = 1
> > > > | configure:22491: error: gobject-introspection-1.0 is not installed
> > > >
> > > > Note that glib-2.0.pc is present in recipes-sysroot-native but not
> > > > in recipes-sysroot.
> > > >
> > > > Adding glib-2.0 to depends allows successful build of libgpiod 2.
> > > >
> > > > Fixes: 117d09ce43c7 ("libgpiod: update to v2.2")
> > > > Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> > > > ---
> > > >  meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb | 2 ++
> > > >  1 file changed, 2 insertions(+)
> > > >
> > > > I'm unsure if that is the correct fix.
> > > > I would have expected that if gobject-introspection-1.0.pc depends
> > > > on glib-2.0 to be present, then the inherit of gobject-introspection
> > > > would have done the needful.
> > > > However I'm not really familiar with gobject-introspection in the
> > > > first place.
> > > >
> > > > Max
> > > >
> > > > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> > > > index b55da72f7b7f..3d9758e27af7 100644
> > > > --- a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> > > > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
> > > > @@ -9,6 +9,8 @@ LIC_FILES_CHKSUM = " \
> > > >      file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
> > > >  "
> > > >
> > > > +DEPENDS += "glib-2.0"
> > > > +
> > >
> > > Pulling in the entire GLib for everything in this recipe is definitely
> > > a wrong answer. I'm travelling and have limited time right now but I
> > > will take a look on Thursday or Friday. I did test disabling
> > > introspection though so I'm surprised to see this.

Thanks for looking for a 'proper' solution.
I digged a bit further.

I noticed that `--enable-introspection` is part of EXTRA_OECONF set by
the gobject-introspection.bbclass (conditions apply).
https://git.openembedded.org/openembedded-core/tree/meta/classes-recipe/gobject-introspection.bbclass#n27
https://git.openembedded.org/openembedded-core/tree/meta/classes-recipe/gobject-introspection-data.bbclass#n12

Instead of depending on glib-2.0 unconditionally, disabling
introspection in configure also makes the build pass.
Assuming that introspection is only used for the glib packageconfig
changing to disabling introspection when not needed might be a solution.

-PACKAGECONFIG[glib] = "--enable-bindings-glib,--disable-bindings-glib,glib-2.0 glib-2.0-native"
+PACKAGECONFIG[glib] = "--enable-bindings-glib,--disable-bindings-glib --disable-introspection,glib-2.0 glib-2.0-native"

Max

> > >
> >
> > There is a problem with this when --enable-introspection is used
> > without ptests being in distro features
> > the reason it works with ptests on is that it enables 'test'
> > packageconfig which brings in glib-2.0 dependency
> > however if we build without 'ptest' DISTRO_FEATURE it will fail to
> > configure like below
> >
> >    configure:22490: checking for gobject-introspection
> >    configure:22499: $PKG_CONFIG --exists --print-errors
> > "gobject-introspection-1.0"
> >    Package glib-2.0 was not found in the pkg-config search path.
> >    Perhaps you should add the directory containing `glib-2.0.pc'
> >    to the PKG_CONFIG_PATH environment variable
> >    Package 'glib-2.0', required by 'gobject-introspection-1.0', not found
> >    configure:22502: $? = 1
> >    configure:22506: error: gobject-introspection-1.0 is not installed
> >
> > The check inconfigure,ac is using GOBJECT_INTROSPECTION_CHECK macro
> > which is expanding to this
> > check I guess.
> >
> > It seems that glib-2.0 is a hard dep for gobject-introspection so it
> > might be better to add it in bbclass itself.
> 
> Forgot to mention that I will apply this patch since some devs have
> reported this so they can keep chugging
> along, we can unbolt it when we have a proper fix.
> 
> >
> > > Bart
> > >
> > > >  FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
> > > >
> > > >  SRC_URI += "file://gpio-manager.init"
> > > > --
> > > > 2.42.0
> > > >
> > > >
> > > >
> > > >
> > >
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > > Links: You receive all messages sent to this group.
> > > View/Reply Online (#113265): https://lists.openembedded.org/g/openembedded-devel/message/113265
> > > Mute This Topic: https://lists.openembedded.org/mt/109255084/1997914
> > > Group Owner: openembedded-devel+owner@lists.openembedded.org
> > > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > >
>
Bartosz Golaszewski Oct. 30, 2024, 4:35 p.m. UTC | #5
Resending from the right account...

On Wed, 30 Oct 2024 at 02:33, Khem Raj <raj.khem@gmail.com> wrote:
>
> On Tue, Oct 29, 2024 at 6:31=E2=80=AFPM Khem Raj <raj.khem@gmail.com> wro=
te:
> >
> > It seems that glib-2.0 is a hard dep for gobject-introspection so it
> > might be better to add it in bbclass itself.

I hope this becomes a conditional thing based on something like:

GOBJECT_INTROSPECTION_PACKAGES =3D "libgpiod-glib"

and won't just pull in GLib for the entire recipe inheriting it? On that no=
te:

>
> Forgot to mention that I will apply this patch since some devs have
> reported this so they can keep chugging
> along, we can unbolt it when we have a proper fix.
>

Well this now does pull GLib even for core libgpiod and gpio-tools
which in reality have no dependencies other than libc. :( I hope we
can get a proper fix in before this ends up in a release...

I'm coming home tomorrow and will have time to look at it.

Bartosz
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
index b55da72f7b7f..3d9758e27af7 100644
--- a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
+++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb
@@ -9,6 +9,8 @@  LIC_FILES_CHKSUM = " \
     file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \
 "
 
+DEPENDS += "glib-2.0"
+
 FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
 
 SRC_URI += "file://gpio-manager.init"