On 2016-01-12 11:47 AM, Guillem Jover wrote: > … a source only build requires running the «debian/rules clean» > target, which also requires checking whether the Build-Depends are > satisfied. > … If one runs «dpkg-buildpackage -S -nc» then it might make sense to > not pre-compute the arch variables
I am indeed running «debuild -S -nc». I have a minimal system that just builds source packages using a script and doesn't need any other tools. In particular, I don't want the build dependencies installed because I'm going to build the binary packages using pbuilder. > I've only skimmed over the code and it might be fine, but I'd have to > check for any hidden assumptions in the code. I'm reassigning it to > dpkg-dev, although this also might need quite some code reshuffling, > because other parts of the code will end up calling gcc if they need > any of the arch values. I've had a look over the code in both debuild and dpkg-buildpackage and I can't see anywhere that uses the environment variables set by dpkg-architecture, except for where DEB_HOST_ARCH is assigned to $arch. When using -S, $arch is assigned with 'source' so the output of dpkg-architecture isn't used anywhere. Here's the search I did: git grep -E 'DEB_(BUILD|HOST|TARGET)_(ARCH|MULTIARCH|GNU)' I'm attaching an additional patch for dpkg-buildpackage.
>From 1abeb34f047d20e6af5992a1fc3ef1243f87ea84 Mon Sep 17 00:00:00 2001 From: Neil Mayhew <[email protected]> Date: Wed, 20 Jan 2016 14:20:25 -0700 Subject: [PATCH] Don't call dpkg-architecture unless it's necessary --- scripts/dpkg-buildpackage.pl | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 17ada97..3c3352e 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -440,27 +440,27 @@ if ($changedby) { } -my @arch_opts; -push @arch_opts, ('--host-arch', $host_arch) if $host_arch; -push @arch_opts, ('--host-type', $host_type) if $host_type; -push @arch_opts, ('--target-arch', $target_arch) if $target_arch; -push @arch_opts, ('--target-type', $target_type) if $target_type; - -open my $arch_env, '-|', 'dpkg-architecture', '-f', @arch_opts - or subprocerr('dpkg-architecture'); -while (<$arch_env>) { - chomp; - my ($key, $value) = split /=/, $_, 2; - $ENV{$key} = $value; -} -close $arch_env or subprocerr('dpkg-architecture'); - my $arch; if (build_sourceonly) { $arch = 'source'; } elsif (build_binaryindep) { $arch = 'all'; } else { + my @arch_opts; + push @arch_opts, ('--host-arch', $host_arch) if $host_arch; + push @arch_opts, ('--host-type', $host_type) if $host_type; + push @arch_opts, ('--target-arch', $target_arch) if $target_arch; + push @arch_opts, ('--target-type', $target_type) if $target_type; + + open my $arch_env, '-|', 'dpkg-architecture', '-f', @arch_opts + or subprocerr('dpkg-architecture'); + while (<$arch_env>) { + chomp; + my ($key, $value) = split /=/, $_, 2; + $ENV{$key} = $value; + } + close $arch_env or subprocerr('dpkg-architecture'); + $arch = mustsetvar($ENV{DEB_HOST_ARCH}, g_('host architecture')); } -- 2.7.0.rc3

