Libraries and packaging problem
Mike A. Harris
mharris at mharris.ca
Wed Mar 29 16:27:14 PST 2006
Claudio Matsuoka wrote:
> Hi,
>
> Mandriva has recently released experimental xorg packages built from the
> modular sources, and we noticed a problem in dependencies: nearly all rpm
> packages were directly depending on packages they shouldn't depend. These
> dependencies were added because pkgconfig cascades linker flags from x11 to
> most libraries that use x11 through Requires.private, e.g.
>
> Name: Xpm
> Description: X Pixmap Library
> Version: 3.5.4.2
> Requires: x11
> Requires.private: x11
> Cflags: -I${includedir}
> Libs: -L${libdir} -lXpm
>
> In the end, binaries linked against libXpm are also linked directly to libXau
> and libXdmcp. http://distro.conectiva.com.br/~claudio/xorg/xman.png shows an
> example, lots more at http://distro.conectiva.com.br/~claudio/xorg/.
>
> The problem in doing so is that if anything is changed in the dependency
> layout in such a way that a library is no longer needed or a new version is
> required, a new release of all packages that require this library will be
> also needed (defeating the upgrade granularity we gained with the modular
> source layout). It also breaks the concept of hierarchy in dependencies,
> making the top-level package directly depending on everything it needs.
>
> Is there a reason to make top-level binaries directly depend on all libraries
> it uses, directly or indirectly? Otherwise, the pkgconfig .pc files could be
> fixed to list only the libraries directly needed by the package, and let the
> linker follow the chain to find what it needs.
Yep, I've pointed that out before also. IMHO, either:
- the pkg-config files provided by X.Org are broken and incorrect and
should be fixed to not have Requires.private
or
- pkg-config itself is a broken design that does not allow a way of
specifying dependencies properly in the manner that is necessary.
My understanding is that Requires.private was only needed by things
that link statically. We do not provide any static X libraries, so
Requires.private _should_ be irrelevent, however when packages get
built, every X library in the entire chain gets linked directly into
every executable even though it doesn't direclty use it.
This could be worked around with as-needed linker flag, but that
does not work because libtool is braindead.
Perhaps we could simply stop using libtool in Xorg 7.1 and solve
the problem that way.
--
Mike A. Harris * Open Source Advocate * http://mharris.ca
Proud Canadian.
More information about the xorg-modular
mailing list