[buildd-tools-devel] Bug#770407: aptitude and apt resolvers differ in ability to find --host build-deps

Johannes Schauer josch at debian.org
Tue Jul 21 05:11:03 UTC 2015


Hi,

On Fri, 21 Nov 2014 02:00:06 +0000 Wookey <wookey at debian.org> wrote:
> I have not yet investigated exactly what is going on, but aptitude is
> installing the wrong-arch libattr-dev despite clearly being set for host arch
> of armhf
> 
> Issues with apt-get update were ruled out by having the host arch set
> in the chroot before starting. It looks like aptitude is not getting
> the host arch setting. Possibly aptitude is not noting the "APT::Architecture
> armhf" config option?

the "APT::Architecture armhf" option is exactly part of what is wrong here.
This apt option sets the apt system architecture or native architecture. But
the native architecture inside a crossbuild chroot with build=amd64 and
host=armhf is not armhf but amd64.

Attached patch fixes the situation:

 - do not set APT::Architecture to the host architecture when cross
   building this just "happens to work" but only sometimes and is thus
   wrong. Apt and dpkg should agree on the native architecture. Instead
   let the dummy package be of the host architecture to properly resolve
   cross build dependencies.
 - build-essential and crossbuild-essential-* must be installed in the
   build architecture and *not* the host architecture
 - do not read /usr/share/doc/build-essential/essential-packages-list
   because build-essential is already installed in an earlier stage.
   This only fails during cross building as it tries to install host
   arch binary packages. Do *not* try to be more clever than a dependency
   resolver! The core dependency on build-essential already does the
   right thing. The removed function read_build_essential will otherwise
   install packages in the wrong architecture as that function does *not*
   include a dependency resolver.
 - aptitude cannot find a package foo if foo is not of the native
   architecture, so append an architecture qualifier to the dummy
   package name in the aptitude command line

cheers, josch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-crossbuild-dependency-resolution-for-apt-and-apt.patch
Type: text/x-diff
Size: 8592 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20150721/08118320/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20150721/08118320/attachment.sig>


More information about the Buildd-tools-devel mailing list