Your message dated Wed, 11 Jul 2018 17:52:07 +0200
with message-id <>
and subject line Re: Bug#897211: stockfish completely messes up use of 
has caused the Debian Bug report #897211,
regarding stockfish completely messes up use of DEB_{BUILD,HOST}_*
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact

Debian Bug Tracking System
Contact with problems
--- Begin Message ---
Source: stockfish
Version: 8-3
Severity: important
Tags: patch
Usertags: rebootstrap

stockfish completely messes up the use of DEB_{BUILD,HOST}_* variables.

 * It does not set defaults for these variables. While dpkg-buildpackage
   sets them, running ./debian/rules directly is still permitted. In
   the latter case, the variables will be empty. An easy way to ensure
   that these variables are available is including
 * It confuses build and host breaking cross compilation. See man
   dpkg-architecture for when to use which.
 * It uses ARCH=general-32 for 64bit targets such as s390x or sparc64.
 * It generally uses loose matching on the architecture name rather than
   relevant aspects (e.g. matching only the cpu part).

The attached patch fixes a significant fraction of these issues while
trying hard not to introduce any accidental regressions. I recommend
moving further using constructs such as

    ifneq (,$(filter $(DEB_HOST_ARCH_CPU),ia64 m68k))

to treat multiple architectures in the same way. The DEB_HOST_ARCH_CPU
variable is subtly different from the DEB_HOST_ARCH. When in doubt,
check the output of dpkg-architecture -a$somearch.

Please consider applying the attached patch.

diff --minimal -Nru stockfish-8/debian/changelog stockfish-8/debian/changelog
--- stockfish-8/debian/changelog        2016-11-12 18:55:54.000000000 +0100
+++ stockfish-8/debian/changelog        2018-04-30 06:53:28.000000000 +0200
@@ -1,3 +1,10 @@
+stockfish (8-3.1) UNRELEASED; urgency=medium
+  * Non-maintainer upload.
+  * Fix us of DEB_{BUILD,HOST}_* variables; closes: #-1.
+ -- Helmut Grohne <>  Mon, 30 Apr 2018 06:53:28 +0200
 stockfish (8-3) unstable; urgency=low
   * Set architecture bits from dpkg-architecture.
diff --minimal -Nru stockfish-8/debian/rules stockfish-8/debian/rules
--- stockfish-8/debian/rules    2016-11-12 11:45:57.000000000 +0100
+++ stockfish-8/debian/rules    2018-04-30 06:53:26.000000000 +0200
@@ -9,64 +9,64 @@
 # Uncomment this to turn on verbose mode.
 # export DH_VERBOSE=1
-DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+include /usr/share/dpkg/
-TARGET := profile-build ARCH=general-$(shell dpkg-architecture 
+TARGET := profile-build ARCH=general-$(DEB_HOST_ARCH_BITS)
-ifneq (,$(findstring i386,$(DEB_BUILD_ARCH)))
+ifeq (i386,$(DEB_HOST_ARCH_CPU))
 TARGET := profile-build ARCH=x86-32-old
-ifneq (,$(findstring amd64,$(DEB_BUILD_ARCH)))
+ifneq (,$(findstring amd64,$(DEB_HOST_ARCH)))
 TARGET := profile-build ARCH=x86-64
 # no compile on the first shot so building without profile
-ifneq (,$(findstring hppa,$(DEB_BUILD_ARCH)))
-TARGET := build ARCH=general-32
+ifeq (hppa,$(DEB_HOST_ARCH_CPU))
+TARGET := build ARCH=general-$(DEB_HOST_ARCH_BITS)
 # no compile on the first shot
-ifneq (,$(findstring powerpc,$(DEB_BUILD_ARCH)))
-TARGET := build ARCH=general-32
+ifneq (,$(findstring powerpc,$(DEB_HOST_ARCH_CPU)))
+TARGET := build ARCH=general-$(DEB_HOST_ARCH_BITS)
-ifneq (,$(findstring s390,$(DEB_BUILD_ARCH)))
-TARGET := profile-build ARCH=general-32
+ifneq (,$(findstring s390,$(DEB_HOST_ARCH_CPU)))
+TARGET := profile-build ARCH=general-$(DEB_HOST_ARCH_BITS)
-ifneq (,$(findstring sparc,$(DEB_BUILD_ARCH)))
-TARGET := build ARCH=general-32
+ifneq (,$(findstring sparc,$(DEB_HOST_ARCH_CPU)))
+TARGET := build ARCH=general-$(DEB_HOST_ARCH_BITS)
-ifneq (,$(findstring mips,$(DEB_BUILD_ARCH)))
-TARGET := profile-build ARCH=general-32
+ifneq (,$(findstring mips,$(DEB_HOST_ARCH_CPU)))
+TARGET := profile-build ARCH=general-$(DEB_HOST_ARCH_BITS)
 # Profiling fails due to compiler issues
-ifneq (,$(findstring mipsel,$(DEB_BUILD_ARCH)))
-TARGET := build ARCH=general-32
+ifneq (,$(findstring mipsel,$(DEB_HOST_ARCH_CPU)))
+TARGET := build ARCH=general-$(DEB_HOST_ARCH_BITS)
-ifneq (,$(findstring alpha,$(DEB_BUILD_ARCH)))
-TARGET := build ARCH=general-64
+ifeq (alpha,$(DEB_HOST_ARCH_CPU))
+TARGET := build ARCH=general-$(DEB_HOST_ARCH_BITS)
 # no compile on the first shot
-ifneq (,$(findstring armel,$(DEB_BUILD_ARCH)))
-TARGET := build ARCH=general-32
+ifneq (,$(findstring armel,$(DEB_HOST_ARCH)))
+TARGET := build ARCH=general-$(DEB_HOST_ARCH_BITS)
-ifneq (,$(findstring armhf,$(DEB_BUILD_ARCH)))
-TARGET := build ARCH=general-32
+ifneq (,$(findstring armhf,$(DEB_HOST_ARCH)))
+TARGET := build ARCH=general-$(DEB_HOST_ARCH_BITS)
-ifneq (,$(findstring ia64,$(DEB_BUILD_ARCH)))
-TARGET := profile-build ARCH=general-64 optimize=no
+ifeq (ia64,$(DEB_HOST_ARCH_CPU))
+TARGET := profile-build ARCH=general-$(DEB_HOST_ARCH_BITS) optimize=no
-ifneq (,$(findstring m86k,$(DEB_BUILD_ARCH)))
-TARGET := build ARCH=general-32
+ifeq (m68k,$(DEB_HOST_ARCH_CPU))
+TARGET := build ARCH=general-$(DEB_HOST_ARCH_BITS)
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))

--- End Message ---
--- Begin Message ---
debian/rules looks basically OK after applying the patch, so I'm closing
the bug.

There may be more specific selections made for certain architectures,
but frankly I little care -- Stockfish can beat me in any case :-).
If anybody is interested enough to check and test better settings,
patches are welcome.

--- End Message ---

Reply via email to