[buildd-tools-devel] Bug#691539: sbuild: Does arch wildcard check outside build chroot not inside, which is wrong when new architectures are added

Wookey wookey at debian.org
Fri Oct 26 16:13:10 UTC 2012


Package: sbuild
Version: 0.63.2-1
Severity: normal

If a new architecture is added to dpkg such that the version inside
the build chroot knows about this, but the version outside does not
then the Arch check stage can fail if the package arch is a wildcard
like 'linux-any'.

Example: 
Quantal dpkg knows about 'arm64'. Precise dpkg does not. Doing sbuild

sbuild -c quantal-cross-arm64-test -kBEA7C52D --host-arch=arm64 -s -A -d quantal libselinux_2.1.9-5ubuntu1.dsc

where this dpkg installed on the machine sbuild is running on gives
this:
dpkg-architecture -aarm64
unknown Debian architecture arm64, you must specify GNU system type, too at /usr/bin/dpkg-architecture line 144.

The offending code is in lib/Sbuild/Build.pm:
    $self->log_subsubsection("Check arch");                                                                                                                       
    if (!$dscarchs) {                                                                                                                                             
        $self->log("$dsc has no Architecture: field -- skipping arch check!\n");                                                                                  
    } else {                                                                                                                                                      
        my $valid_arch;                                                                                                                                           
        for my $a (split(/\s+/, $dscarchs)) {                                                                                                                     
            if (Dpkg::Arch::debarch_is($host_arch, $a)) {                                                                                                         
                $valid_arch = 1;                                                                                                                                  
                last;                                                                                                                                             
            }                                                  

That arch check should (I think) be done inside the chroot, where it
will come out correct. 

This problem can't, in practice, arise for a native build, because dpkg will
always know about the host-arch, because sbuild will already be
running on it, but in principle the check should always be done inside
the chroot, not outside. 

This problem was discovered doing builds using precise witha quantal
chroot, but should be reproducible on Debian using squeeze with a wheezy
chroot in just the same way. 

It doesn't arise for packages of arch 'any' because then no explicit arch list
is checked. 

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages sbuild depends on:
ii  adduser         3.113+nmu3
ii  apt-utils       0.9.7.5
ii  libsbuild-perl  0.63.2-1
ii  perl            5.14.2-13
ii  perl-modules    5.14.2-13

Versions of packages sbuild recommends:
ii  debootstrap  1.0.42
ii  fakeroot     1.18.4-2

Versions of packages sbuild suggests:
pn  deborphan  <none>
ii  wget       1.13.4-3

-- no debconf information



More information about the Buildd-tools-devel mailing list