Debian Bug report logs - #456335
gtk+2.0: pkg-config files should use private depends on libraries

version graph

Package: gtk+2.0; Maintainer for gtk+2.0 is Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>;

Reported by: Bas Wijnen <wijnen@debian.org>

Date: Fri, 14 Dec 2007 17:54:01 UTC

Severity: minor

Found in version 2.12.3-2

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Sebastien Bacher <seb128@debian.org>:
Bug#456335; Package gtk+2.0. (full text, mbox, link).


Acknowledgement sent to Bas Wijnen <wijnen@debian.org>:
New Bug report received and forwarded. Copy sent to Sebastien Bacher <seb128@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Bas Wijnen <wijnen@debian.org>
To: submit@bugs.debian.org
Subject: gtk+2.0: pkg-config files should use private depends on libraries
Date: Fri, 14 Dec 2007 18:51:23 +0100
[Message part 1 (text/plain, inline)]
Package: gtk+2.0
Version: 2.12.3-2
Severity: minor

The *.pc files of the libraries have a "Requires:" relation to the
libraries they need themselves.  This is not the proper way to do this.
"Requires:" is meant for libraries which need to be directly linked by
any program linking the library.  This can happen, for example, when
inline functions in header files reference symbols from the other
library.  Those references then end up in the executable, and so it
should link directly to said library (if the inline function is actually
called.  Pkg-config can't actually find this out, so that's a problem in
itself).

For the usual case, where the library uses the other library internally,
the relation should be written as "Requires.private:".  This lets
pkg-config figure out if the system's ld can handle implicit recursive
dependencies, and if so, omit the direct link.  This is good, because it
makes it easier to transition the depended-on library (it has fewer
dependencies).

The result of using "Requires.private:" in all .pc files instead of
"Requires:" would mean:

- Programs which really use Gdk/Atk/... directly must link to these as
  well.  I think it will not even fail on Debian, because they are
  linked in through Gtk (both with dynamic and static linking), but at
  least theoretically they should specify this dependency themselves.

- dpkg_shlibdeps stops giving loads of warnings about linking to
  libraries that aren't used.  This is a good thing, because the problem
  that it warned about was real, and will have been solved.

I hope I have convinced you that this is a good change. :-)

Thanks,
Bas

-- 
I encourage people to send encrypted e-mail (see http://www.gnupg.org).
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see http://pcbcn10.phys.rug.nl/e-mail.html
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Sebastien Bacher <seb128@debian.org>:
Bug#456335; Package gtk+2.0. (full text, mbox, link).


Acknowledgement sent to 456335@bugs.debian.org:
Extra info received and forwarded to list. Copy sent to Sebastien Bacher <seb128@debian.org>. (full text, mbox, link).


Message #10 received at 456335@bugs.debian.org (full text, mbox, reply):

From: Josselin Mouette <joss@debian.org>
To: Bas Wijnen <wijnen@debian.org>, 456335@bugs.debian.org
Subject: Re: Bug#456335: gtk+2.0: pkg-config files should use private depends on libraries
Date: Mon, 17 Dec 2007 18:47:49 +0100
[Message part 1 (text/plain, inline)]
Hi,

Le vendredi 14 décembre 2007 à 18:51 +0100, Bas Wijnen a écrit :
> For the usual case, where the library uses the other library internally,
> the relation should be written as "Requires.private:".

We have already moved a lot of these dependencies to Requires.private,
but some are more questionable. Those removals should be done very
carefully, especially because C++ packages will FTBFS if they don’t
explicitly link to a library they require.


* gdk-pixbuf-2.0.pc

This is the only one requiring gobject-2.0 and gmodule-no-export-2.0.
Which is highly questionable, because all libraries should require
gobject, and gtk should require gmodule. I suspect other libraries
require gdk-pixbuf only to get these dependencies.

* gdk-x11-2.0.pc

Here, the dependency on gdk-pixbuf-2.0 should probably be moved to
Requires.privates, but replacing it with gobject-2.0.

Only remain pango and pangocairo. The GdkPango primitives heavily rely
on pango types and functions, and any code using them is bound to use
pango functions as well.

However it can be argued that in these cases the application should
already depend on pangocairo by itself, so it looks fine to remove them.

* gtk+-x11-2.0.pc

I think it is hopeless to remove gdk-x11-2.0. GTK+ relies so heavily on
GDK that most applications using both are probably requiring only GTK+.
Removing it will only break many applications.

Atk only looks accessible by functions returning Atk types, so I guess
it could be removed.

I don't understand why cairo is here. It should be in gdk-x11-2.0,
because this is where the cairo interface lies.

* gtk+-unix-print-2.0.pc

This is merely a wrapper that always bring gtk+-x11-2.0. Anything else
should be removed.

* gdk-pixbuf-xlib-2.0.pc

gobject and gdk-pixbuf-2.0 should be kept. I don’t think there’s any
point for gmodule, even in Requires.privates.

* gtk+-directfb-2.0.pc

Same as gtk+-x11.

* gdk-directfb-2.0.pc

This one is a giant mess, and the reason is the rpath. Everything fails
if the rpath isn’t propagated to *all* binaries linking to the library,
even indirectly. The real solution is, before any other fix, to get rid
of this rpath and give the directfb version of cairo a different soname.


Because all these dependencies are created by the configure script, it
is a lot of work to remove them properly, so don’t expect this to be
done in a snap. I also think we should prepare a package in experimental
and ask for a full archive rebuild with it.

-- 
 .''`.
: :' :      We are debian.org. Lower your prices, surrender your code.
`. `'       We will add your hardware and software distinctiveness to
  `-        our own. Resistance is futile.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Sebastien Bacher <seb128@debian.org>:
Bug#456335; Package gtk+2.0. (full text, mbox, link).


Acknowledgement sent to Bas Wijnen <shevek@fmf.nl>:
Extra info received and forwarded to list. Copy sent to Sebastien Bacher <seb128@debian.org>. (full text, mbox, link).


Message #15 received at 456335@bugs.debian.org (full text, mbox, reply):

From: Bas Wijnen <shevek@fmf.nl>
To: 456335@bugs.debian.org
Subject: Re: Bug#456335: gtk+2.0: pkg-config files should use private depends on libraries
Date: Mon, 17 Dec 2007 19:44:28 +0100
[Message part 1 (text/plain, inline)]
On Mon, Dec 17, 2007 at 06:47:49PM +0100, Josselin Mouette wrote:
> Hi,

Hi,

> Le vendredi 14 décembre 2007 à 18:51 +0100, Bas Wijnen a écrit :
> > For the usual case, where the library uses the other library internally,
> > the relation should be written as "Requires.private:".
> 
> Because all these dependencies are created by the configure script, it
> is a lot of work to remove them properly, so don’t expect this to be
> done in a snap.

Of course not.  I just wanted to have it reported, because of all
warnings I've seen from the new dpkg-shlibdeps, there were hardly any
which didn't come from gtk related stuff. ;-)

> I also think we should prepare a package in experimental
> and ask for a full archive rebuild with it.

Sounds reasonable.

Thanks,
Bas

-- 
I encourage people to send encrypted e-mail (see http://www.gnupg.org).
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see http://pcbcn10.phys.rug.nl/e-mail.html
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Tue Sep 2 19:15:20 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.