Bug 2030 - pkgconfig.bbclass requires pkgconfig and breaks poky-tiny build
Summary: pkgconfig.bbclass requires pkgconfig and breaks poky-tiny build
Status: RESOLVED FIXED
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: High critical
Target Milestone: ---
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-02-25 06:33 UTC by Darren Hart
Modified: 2012-02-26 12:03 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darren Hart 2012-02-25 06:33:21 UTC
The following commit changed pkgconfig.bbclass from requiring pkgconfig-native to also requiring pkgconfig. This pulls in glib->dbus->shadow which fails configure for poky-tiny with its minimized libc configuration.

commit 76640582e8ba114d4e80a494f6680fd0ce57ca58
Author: Richard Purdie <richard.purdie@linuxfoundation.org>
Date:   Tue Jan 31 15:52:27 2012 +0000

    pkgconfig: Ensure pkgconfig RDEPENDS are tracked

    Currently, pkgconfig dependencies get added to -dev packages which install
    pc files however nothing in the system makes bitbake aware of these
    dependencies so images can fail with pkgconfig being missing.
    
    This change explictly adds in the pkgconfig RDEPENDS to the -dev packages
    and hence makes bitbake aware of the dependency.
    
    (From OE-Core rev: 23e773eb8b70a5e36270b2e6415512b7dc4f1e05)
    
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>


This appears to be targetting the -dev packages only, but it also affects "opkg". Is this intentional? I really don't want to require glib for poky-tiny, whether or not we can remove the recently added dep on dbus.
Comment 1 Darren Hart 2012-02-25 06:34:18 UTC
Note: this may very well be a bug against poky-tiny and not the pkgconfig change. I would just like Richard's take on the intent of the patch.
Comment 2 Richard Purdie 2012-02-25 12:01:48 UTC
The trouble is if we build anything which has a -dev package, if we
install that, we need to have pkgconfig around since the package will
auto depend on pkgconfig thanks to rpm's auto dependencies. The
dependency is therefore correct and it won't actually change your image
size, its just a correctness issue.

I appreciate that it pulling in glib and popt is a pain though. I was
curious why as much stuff breaks since we're supposed to support nls
free images, at least in theory from the patches I see. There are
several things that caught my eye:

* USE_NLS=yes in glib-2.0's recipe (overriding the "no" distro setting)
* eglibc declaring ac_cv_header_langinfo_h (which causes popt to call
nl_langinfo)
* popthelp.c has a POPT_WCHAR_HACK define which looks like we could
disable wchar support through

So it looks like popt could be fixed relatively easily but glib-2.0 has
a hard gettext dependency at least in policy.

The annoying thing is I know pkgconfig only uses a small subset of
glib-2.0 and certainly doesn't care about nls. It used to ship its own
small glib-1.0 based shim but the authors removed that :(.

So how to fix this? The best I could come up with was:

diff --git a/meta-yocto/conf/distro/poky-tiny.conf b/meta-yocto/conf/distro/poky-tiny.conf
index 411347a..5d1d67a 100644
--- a/meta-yocto/conf/distro/poky-tiny.conf
+++ b/meta-yocto/conf/distro/poky-tiny.conf
@@ -108,3 +108,5 @@ IMAGE_FSTYPES = "ext2 cpio.gz"
 #        variants of all compatible machines, but that leads to a lot
 #        more machine configs to maintain long term.
 MACHINE_ESSENTIAL_EXTRA_RDEPENDS = ""
+
+ASSUME_PROVIDED += "pkgconfig$"

which would mean images using the -dev packages might break but
otherwise things work just fine. I confirmed poky-tiny builds with this
applied.
Comment 3 Darren Hart 2012-02-25 16:12:52 UTC
> The dependency is therefore correct and it won't actually change your image
> size, its just a correctness issue.

You mean that my image size won't change because I am not installing any -dev packages in poky-tiny right?

Is there a mechanism whereby we can specify "don't build any -dev pacakges" and then limit the pkgconfig requirement only if you build -dev?

> * popthelp.c has a POPT_WCHAR_HACK define which looks like we could
> disable wchar support through

I had to do something similar for ncurses via ENABLE_WIDEC. Perhaps popt can be modified to use the same mechanism.


> diff --git a/meta-yocto/conf/distro/poky-tiny.conf
> b/meta-yocto/conf/distro/poky-tiny.conf
> index 411347a..5d1d67a 100644
> --- a/meta-yocto/conf/distro/poky-tiny.conf
> +++ b/meta-yocto/conf/distro/poky-tiny.conf
> @@ -108,3 +108,5 @@ IMAGE_FSTYPES = "ext2 cpio.gz"
>  #        variants of all compatible machines, but that leads to a lot
>  #        more machine configs to maintain long term.
>  MACHINE_ESSENTIAL_EXTRA_RDEPENDS = ""
> +
> +ASSUME_PROVIDED += "pkgconfig$"

This is OK, and I can document -dev packages being unsupported in -tiny. It's probably the most appropriate fix for the time being.
Comment 4 Richard Purdie 2012-02-25 16:15:30 UTC
(In reply to comment #3)
> > The dependency is therefore correct and it won't actually change your image
> > size, its just a correctness issue.
> 
> You mean that my image size won't change because I am not installing any -dev
> packages in poky-tiny right?
> 
> Is there a mechanism whereby we can specify "don't build any -dev pacakges" and
> then limit the pkgconfig requirement only if you build -dev?

Not really, no :/.

> > * popthelp.c has a POPT_WCHAR_HACK define which looks like we could
> > disable wchar support through
> 
> I had to do something similar for ncurses via ENABLE_WIDEC. Perhaps popt can be
> modified to use the same mechanism.

Right. Sadly that doesn't solve the glib-2.0 problem though.

> 
> > diff --git a/meta-yocto/conf/distro/poky-tiny.conf
> > b/meta-yocto/conf/distro/poky-tiny.conf
> > index 411347a..5d1d67a 100644
> > --- a/meta-yocto/conf/distro/poky-tiny.conf
> > +++ b/meta-yocto/conf/distro/poky-tiny.conf
> > @@ -108,3 +108,5 @@ IMAGE_FSTYPES = "ext2 cpio.gz"
> >  #        variants of all compatible machines, but that leads to a lot
> >  #        more machine configs to maintain long term.
> >  MACHINE_ESSENTIAL_EXTRA_RDEPENDS = ""
> > +
> > +ASSUME_PROVIDED += "pkgconfig$"
> 
> This is OK, and I can document -dev packages being unsupported in -tiny. It's
> probably the most appropriate fix for the time being.

Agreed.
Comment 5 Darren Hart 2012-02-25 16:19:35 UTC
> > > +ASSUME_PROVIDED += "pkgconfig$"
> > 
> > This is OK, and I can document -dev packages being unsupported in -tiny. It's
> > probably the most appropriate fix for the time being.
> 
> Agreed.

I'm testing now. I've added some comments to this patch and will send to yocto shortly.