[buildd-tools-devel] Bug#798323: Building for i386 on amd64 tries to install amd64 packages into i386 chroot

Johannes Schauer josch at debian.org
Fri Sep 11 12:46:24 UTC 2015


Hi,

thanks Gaudenz for testing the version in experimental and thanks Simon for
even preparing a patch!

Quoting Simon McVittie (2015-09-11 12:16:56)
> On Tue, 08 Sep 2015 at 08:03:26 +0200, Gaudenz Steinlin wrote:
> > The sbuild NMU to experimental broke building packages for i386 on an
> > amd64 host with an i386 chroot and setting personality=linux32 in the
> > schroot configuration. sbuild tries to wrongly install
> > build-essential:amd64 and fakeroot:amd64 into this chroot. It should
> > instead install i386 packages.
> 
> Please consider the attached patch. With this change applied to sbuild
> git master, these builds succeed on an amd64 machine, using a chroot
> sid-i386-sbuild previously created with sbuild-createchroot:
> 
> sbuild --arch=i386 -d unstable hello_2.10-1
> - Machine Architecture: amd64
> - Host Architecture: i386
> - Build Architecture: i386
> 
> sbuild --build=i386 --host=armhf -d unstable hello_2.10-1
> - Machine Architecture: amd64
> - Host Architecture: armhf
> - Build Architecture: i386

it seems the problem comes from the --arch command line option only setting the
BUILD_ARCH configuration option *after* the value CORE_DEPENDS is evaluated.

One solution (as proposed in Simons patch) would be to add the architecture
qualifier for the build architecture at a later point when the value of
BUILD_ARCH is not the default one anymore. But this solution has two problems:

 1. the CORE_DEPENDS option currently accepts package relationships in any
    format parseable by the libdpkg-perl function Dpkg::Deps::deps_parse(...,
    build_dep => 1, ...). This means one could give it "foobar (>= 1)" which
    would break with the proposed patch. One way to fix this would be to parse
    the CORE_DEPENDS with deps_parse and then set the architecture qualifier to
    the build architecture, but this leads to a second problem:

 2. if the user puts foobar:myarch in their CORE_DEPENDS, then I think they can
    reasonably expect that their architecture qualifier is not overwritten at
    some point.

I thus think that the proper fix would be the attached patch which, instead of
setting the build architecture manually, uses the :native qualifier in
CORE_DEPENDS. This would defer the translation of :native to the build
architecture to when the core dependencies are actually installed and would
also not suffer from either of the above problems.

Thanks!

cheers, josch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_798323.patch
Type: text/x-diff
Size: 1845 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20150911/2542394a/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/20150911/2542394a/attachment.sig>


More information about the Buildd-tools-devel mailing list