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

Bug#629385: Request for TC to rule on a course of action for supporting build-arch



(Bcc to debian-dpkg for info)

On Mon, 06 Jun 2011, Steve Langasek wrote:
> If this were to be put to a vote today, I would propose the following ballot
> options:
> 
>  1) Implement support for calling 'debian/rules build-arch' in place of
>     'debian/rules build' by checking for the presence of the target using
>     'make -qn'.[1]
> 
>  2) Implement support for calling 'debian/rules build-arch' with a fallback
>     to 'debian/rules build' by checking whether the output of the build-arch
>     target matches that of a dummy target.[2]
> 
>  3) Implement support for calling 'debian/rules build-arch' in place of
>     'debian/rules build' if a Build-Options field is set in debian/control
>     of the source package specifying that this target is supported.[3]
> 
>  4) Turn on direct use of 'debian/rules build-arch' on the autobuilders for
>     all packages in unstable and experimental immediately, with no fallback
>     if the target does not exist; requires a corresponding update to Policy
>     and mass updates to fix packages that fail to build as a result.
> 
>  5) Further Discussion

I suggest a supplementary option that combines 4 and 1. And I attach the
corresponding dpkg patch.

---
Turn on direct use of "debian/rules build-arch" unless the package seems
to be missing the target according to "make -qn". In that case output a
warning that asks the packager to implement the required targets, but
fallback to using the "build" target.

The fallback to build and the "make -qn" auto-detection is temporary to
ease the transition but should dropped at some point (wheezy+1, or
wheezy+2). The policy should document that the targets must be supported.
---

Lucas, can you do a full rebuild with the packages below ?
http://people.debian.org/~hertzog/packages/dpkg-dev_1.16.1~buildarch.1_all.deb
http://people.debian.org/~hertzog/packages/libdpkg-perl_1.16.1~buildarch.1_all.deb

You should use a binary-only build (i.e. dpkg-buildpackage -B or -A for
packages which are arch: all).

I would like to know if it introduces new build failures, and
also how many packages have this warning:
dpkg-buildpackage: warning: debian/rules must be updated to support the 'build-arch' and 'build-indep' targets (at least 'build-arch' seems to be missing)

grep just on "debian/rules must be updated to support", the parenthesis
can vary between -B and -A. Also you can only see the warning if you use
-B or -A, with -b (the default), you can't generate it.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 32427a0..a7d217c 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -32,6 +32,7 @@ use Dpkg::Compression;
 use Dpkg::Version;
 use Dpkg::Changelog::Parse;
 use Dpkg::Path qw(find_command);
+use Dpkg::IPC;
 
 textdomain("dpkg-dev");
 
@@ -253,7 +254,22 @@ if ($noclean) {
 }
 
 my $buildfeats = Dpkg::BuildFeatures->new();
-$buildtarget = 'build' unless $buildfeats->has('build-arch');
+unless ($buildtarget eq "build" or $buildfeats->has('build-arch') or
+        scalar(@debian_rules) > 1) {
+    my $pid = spawn(exec => [ "make", "-f", @debian_rules, "-qn", $buildtarget ],
+                    from_file => "/dev/null", to_file => "/dev/null",
+                    error_to_file => "/dev/null");
+    my $cmdline = "make -f @debian_rules -qn $buildtarget";
+    wait_child($pid, nocheck => 1, cmdline => $cmdline);
+    my $exitcode = WEXITSTATUS($?);
+    subprocerr($cmdline) unless WIFEXITED($?);
+    if ($exitcode == 2) {
+	warning(_g("%s must be updated to support the 'build-arch' and " .
+	           "'build-indep' targets (at least '%s' seems to be " .
+	           "missing)"), "@debian_rules", $buildtarget);
+	$buildtarget = "build";
+    }
+}
 
 if ($< == 0) {
     warning(_g("using a gain-root-command while being root")) if (@rootcommand);

Reply to: