This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=f4a75f1382b7f69ef6ef05fc8e35190e5452a070

commit f4a75f1382b7f69ef6ef05fc8e35190e5452a070
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Sat Feb 10 13:43:24 2024 +0100

    dpkg-buildpackage: Remove fallback handling for missing required targets
    
    The fallback code that was auto-detecting for potentially missing
    build-arch and build-indep targets has been there since 2012, and has
    increasingly been restricted. In Debian there was a mass bug filing
    and there's now only a handful of packages missing these. It has come
    the time to remove this fallback code and fully require these targets,
    which means we can now avoid the auto-detection and fallback code.
---
 man/dpkg-buildpackage.pod    |  8 +++----
 scripts/dpkg-buildpackage.pl | 51 --------------------------------------------
 2 files changed, 3 insertions(+), 56 deletions(-)

diff --git a/man/dpkg-buildpackage.pod b/man/dpkg-buildpackage.pod
index f90471ddf..eb5fd5534 100644
--- a/man/dpkg-buildpackage.pod
+++ b/man/dpkg-buildpackage.pod
@@ -908,12 +908,10 @@ This is no longer the case.
 
 B<dpkg-buildpackage> is using the B<build-arch> and
 B<build-indep> targets since dpkg 1.16.2.
+Before dpkg 1.22.7,
+there was code to try to detect the missing targets and fallback on the
+B<build> target.
 Those targets are thus mandatory.
-But to avoid breakages of existing packages, and ease
-the transition, if the source package does not build both architecture
-independent and dependent binary packages (since dpkg 1.18.8) it will
-fallback to use the B<build> target if B<make -f debian/rules -qn>
-I<build-target> returns 2 as exit code.
 
 =head1 SECURITY
 
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 7b8181b48..a91540bc2 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -670,13 +670,6 @@ if (build_has_any(BUILD_SOURCE)) {
 
 my $build_types = get_build_options_from_type();
 
-if (build_has_any(BUILD_BINARY)) {
-    # XXX Use some heuristics to decide whether to use build-{arch,indep}
-    # targets. This is a temporary measure to not break too many packages
-    # on a flag day.
-    build_target_fallback($ctrl);
-}
-
 # If we are building rootless, there is no need to call the build target
 # independently as non-root.
 if (build_has_any(BUILD_BINARY) && rules_requires_root($binarytarget)) {
@@ -1049,47 +1042,3 @@ sub describe_build {
         return g_('full upload (original source is included)');
     }
 }
-
-sub build_target_fallback {
-    my $ctrl = shift;
-
-    # If we are building rootless, there is no need to call the build target
-    # independently as non-root.
-    return if not rules_requires_root($binarytarget);
-
-    return if $buildtarget eq 'build';
-    return if scalar @debian_rules != 1;
-
-    # Avoid further heuristics in newer dpkg-build-api levels.
-    return if get_build_api($ctrl) >= 1;
-
-    # Check if we are building both arch:all and arch:any packages, in which
-    # case we now require working build-indep and build-arch targets.
-    my $pkg_arch = 0;
-
-    foreach my $bin ($ctrl->get_packages()) {
-        if ($bin->{Architecture} eq 'all') {
-            $pkg_arch |= BUILD_ARCH_INDEP;
-        } else {
-            $pkg_arch |= BUILD_ARCH_DEP;
-        }
-    }
-
-    return if $pkg_arch == BUILD_BINARY;
-
-    # Check if the build-{arch,indep} targets are supported. If not, fallback
-    # to build.
-    my $pid = spawn(exec => [ $Dpkg::PROGMAKE, '-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';
-    }
-}

-- 
Dpkg.Org's dpkg

Reply via email to