Subject: binutils FTCBFS: does not honour DEB_BUILD_OPTIONS=nocheck for some architectures

From: Helmut Grohne <[email-masked]>
Date: Wed, 7 Jul 2021 18:34:37 +0200

Source: binutils
Version: 2.35.2-2
Tags: patch
User: [email-masked]
Usertags: ftcbfs
User: [email-masked]
Usertags: rebootstrap

binutils' debian/rules has code to specifically ignore
DEB_BUILD_OPTIONS=nocheck when building for e.g. m68k. I suppose this is
in place to override buildd maintainers that set this option. Working
around such disagreements using code seems like a suboptimal solution,
but I prefer not being dragged into this dispute. Unfortunately, it
happens to break cross building e.g. from amd64 to m68k. As a
compromise, I propose reducing the impact of this code to specifically
exempt all cross builds from ignoring nocheck. Would that be acceptable?

I'm attaching a patch for unstable for your convenience. It doesn't
apply cleanly to experimental. Another form of the patch is:

    sed -i -e 's/ifeq (\(,$(filter $(DEB_HOST_ARCH),\)/ifneq ($(DEB_BUILD_ARCH)\1/' debian/rules

Helmut
diff --minimal -Nru binutils-2.35.2/debian/changelog binutils-2.35.2/debian/changelog
--- binutils-2.35.2/debian/changelog	2021-02-20 16:38:30.000000000 +0100
+++ binutils-2.35.2/debian/changelog	2021-07-07 07:29:03.000000000 +0200
@@ -1,3 +1,10 @@
+binutils (2.35.2-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Honour nocheck option during cross builds. Closes: #-1.
+
+ -- Helmut Grohne <[email-masked]>  Wed, 07 Jul 2021 07:29:03 +0200
+
 binutils (2.35.2-2) unstable; urgency=medium
 
   * Add debugedit as dependency for the build autopkg test.
diff --minimal -Nru binutils-2.35.2/debian/rules binutils-2.35.2/debian/rules
--- binutils-2.35.2/debian/rules	2021-02-19 18:21:07.000000000 +0100
+++ binutils-2.35.2/debian/rules	2021-07-07 07:29:01.000000000 +0200
@@ -550,7 +550,7 @@
 with_check := yes
 ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
   # override buildd admins to run the testsuite anyway ...
-  ifeq (,$(filter $(DEB_HOST_ARCH), m68k sh4))
+  ifneq ($(DEB_BUILD_ARCH),$(filter $(DEB_HOST_ARCH),m68k sh4))
     with_check := disabled through DEB_BUILD_OPTIONS
   endif
 endif