[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dpkg-cross behaviour in large dependency trees



The problems with apt-cross and dependency calculations are not helped
by a confusing behaviour within dpkg-cross.

e.g.
$ cd /tmp
$ apt-cross -v -v -i aptitude
(be prepared to use Ctrl-C on this one.)

apititude depends on libapt-pkg-libc6-foo, which is part of apt (not
libapt) and this is where the problems start.

$ dpkg -L apt | grep libapt-pkg-libc6
/usr/lib/libapt-pkg-libc6.3-6.so.3.11.0
/usr/lib/libapt-pkg-libc6.3-6.so.3.11

So to make libapt-pkg-libc6-foo available to arm-linux-gnu-gcc, apt has
to be passed to dpkg-cross.

In order to build aptitude, libapt-pkg-dev needs to be available to
arm-linux-gnu-gcc so that also has to be passed to dpkg-cross.

Originally, libapt-pkg-dev lists:
Depends: apt (= 0.6.46.4-0.1), apt-utils (= 0.6.46.4-0.1), libapt-pkg-libcfoo

libapt-pkg-dev-arm-cross results in:
Depends: apt-arm-cross (= 0.6.46.4-0.1), apt-utils-arm-cross (= 0.6.46.4-0.1), libapt-pkg-libcfoo-arm-cross

And now the problems really start.

When apt is passed to dpkg-cross, the debian-archive-keyring dependency
of apt becomes debian-archive-keyring-arm-cross which is more than just
pointless - it perpetuates the theme down the entire dependency tree
because that depends on gnupg-arm-cross. At some point,
debconf-arm-cross appears, then perl-arm-cross and all of a sudden just
cross-building aptitude means passing an entire Debian rootfs through
dpkg-cross - I'd estimate >100 packages but even I haven't left the
above script running long enough to find out.

It's not just apititude either - I believe this is the single biggest
problem making anything in X11 cross-build - packages currently complain
that they cannot locate a cross-version of x11-proto and trying to
prepare a cross version brings up dozens of other dependencies that
appear to need to be passed to dpkg-cross but which, on closer
inspection, have nothing to do with making x11-proto or libapt-pkg-dev
accessible to arm-linux-gnu-gcc.

AFAICT, the basic problem is this:

To cross-build, arm-linux-gnu-gcc only needs access to the files
in /usr/arm-linux-gnu/include and the shared libraries
in /usr/arm-linux-gnu/lib/. None of the executable files in the various
packages can or should be run by the cross-compiler, it should (IMHO
must) confine itself to the header files and the shared libraries.

The problem is that dpkg-cross doesn't know what is in
debian-archive-keyring when it is processing apt so it cannot take
the logical option of NOT renaming that particular dependency.
apt-cross could do that but this would require a new option in
dpkg-cross to override the existing behaviour. apt-cross could check
the dependency before passing the downloaded .deb to dpkg-cross and if
there are no shared libraries in the package, tell dpkg-cross NOT to
alter the package name in any dependency information for the relevant
package.

Something like:
dpkg-cross -b apt_0.6.46.4-0.1_arm.deb -X debian-archive-keyring

Meaning: convert apt but don't change the dependency information for
debian-archive-keyring within the converted apt package.

That option would have to be repeated many, many times in the case of
some packages, like x11-common. This would mean that using -X prevents
passing more than one .deb to dpkg-cross in a single call. apt-cross
would handle that by only calling dpkg-cross -b and then passing all
the necessary packages to sudo dpkg -i instead of using sudo dpkg-cross
-i.

Is that sane?

Try:
$ apt-cross -g apt
$ dpkg-cross -b apt_0.6.46.4-0.1_arm.deb
$ dpkg -I apt-arm-cross_0.6.46.4-0.1_all.deb | grep Depends
 Depends: libc6-arm-cross (>= 2.3.5-1), libc6-arm-dcv1, libgcc1-arm-cross (>= 1:4.1.1-12), libgcc1-arm-dcv1, libstdc++6-arm-cross (>= 4.1.1-12), libstdc++6-arm-dcv1, debian-archive-keyring-arm-cross, debian-archive-keyring-arm-dcv1

What I need is:
 Depends: libc6-arm-cross (>= 2.3.5-1), libc6-arm-dcv1, libgcc1-arm-cross (>= 1:4.1.1-12), libgcc1-arm-dcv1, libstdc++6-arm-cross (>= 4.1.1-12), libstdc++6-arm-dcv1, debian-archive-keyring

So that apt-arm-cross can be installed without the pointless conversion
of debian-archive-keyring and all that this entails.

Is the lack of /usr/lib/*.so* sufficient evidence to discount packages
like debian-archive-keyring from conversion in the dependency list of
other packages?

The advantage for apt-cross is that once debian-archive-keyring has
been identified as not containing any relevant files, not only can it
pass that package to -X but apt-cross can also discount the package
from subsequent dependency checks - dependencies of
debian-archive-keyring would simply not be checked. This would cut the
time required to calculate the dependency list exponentially.

The other problem is versioned dependencies on non-useful packages -
leaving these intact would severely impair the normal apt-get upgrade
process for native packages so as these binaries should never actually
be executed, I think the version can and should be dropped entirely.
Come to think of it, maybe dpkg-cross -X should just drop that package
from the Depends completely:

 Depends: libc6-arm-cross (>= 2.3.5-1), libc6-arm-dcv1, libgcc1-arm-cross (>= 1:4.1.1-12), libgcc1-arm-dcv1, libstdc++6-arm-cross (>= 4.1.1-12), libstdc++6-arm-dcv1

i.e. only allow the cross package to depend on packages that actually
contain either header files or shared libraries.

What have I missed?
:-)

--


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgpxJ9cQSGfo5.pgp
Description: PGP signature


Reply to: