dpkg-shlibdeps undocumented behaviour question
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
(CCing to zlib maintainer because that package is affected)
Hello.
While trying to debug dpkg-cross's dpkg-shlibdeps wrapper, I found an issue
with dpkg-shlibdeps.
Documentation says that dpkg-shlibdeps looks at the following places to
locate shlibs information:
- - debian/shlibs.local (or what is set in -L command-line switch)
- - /etc/dpkg/shlibs.override
- - approptiate .shlibs files from installed packages
- - /etc/dpkg/shlibs.default
However, actually there is code in dpkg-shlibdeps that makes it to look
also into debian/*/DEBIAN/shlibs (more particular, it takes first file
argument into $searchdir, stips leading directory from $searchdir until
$searchdir/DEBIAN exists, then strips leading directory once more, and
starting from this point recursively searches for DEBIAN/shlibs files; in
common use case this will result into debian/*/DEBIAN/shlibs).
At least one package - zlib - currently depends on this (undocumented)
behaviour to get shlibs information for zlib-bin package. In zlib package,
local shlib information is in debian/shlibs, zlib1g binary package tree is
prepared in debian/tmp (so shlib information goes to
debian/tmp/DEBIAN/shlibs), and later in build process shlib information
for zlib-bin is found using
dh_shlibdeps -p zlib-bin -lbuild-tree/zlib-1.2.2 -Lzlib1g
which in turn calls
dpkg-shlibdeps -Tdebian/zlib-bin.substvars -Ldebian/zlib1g/DEBIAN/shlibs
debian/zlib-bin/usr/bin/miniunzip debian/zlib-bin/usr/bin/minizip
When compiling native packages, this succeeds, because dpkg-shlibdeps looks
into debian/tmp/DEBIAN/shlibs (while it is not instructed to). I first
found that using strace, and later analyzed the code.
When cross-compiling with dpkg-cross, this fails (unless
zlib1g-<arch>-cross is already installed), because dpkg-cross's
dpkg-shlibdeps wrapper currently does not duplicate the undocumented
behaviour of dpkg-shlibdeps.
I probably should add same behaviour to dpkg-cross's dpkg-shlibdeps
wrapper.
But is that the rigth thing to do?
Maybe the feature in question should be removed, and affected packages
should be fixed? (In case of zlib, the fix could be e.g. to use
dh_shlibdeps -pzlib-bin -lbuild-tree/zlib-1.2.2 -- -Ldebian/shlibs)
The arguments for removal are:
- - documented features seem to be enough to handle almost anything;
- - the drawback of using debian/*/DEBIAN/shlibs is that at moment when
dpkg-shlibdeps is called during package build, not all binary package
trees are already available, so usage of debian/*/DEBIAN/shlibs results
into hard-understandable effect
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBqjL7v3x5OskTLdsRAjsHAKDHRZ7YJ6GxG7IG5FyqsUF73Dx58gCghZkR
1Wvly4JG5LDoBVkjPQnmm4g=
=uFyE
-----END PGP SIGNATURE-----
Reply to: