[From nobody Sun Jun 28 16:54:07 2026
Received: (at submit) by bugs.debian.org; 4 Dec 2024 16:51:19 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.6-bugs.debian.org_2005_01_02
 (2021-04-09) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.7 required=4.0 tests=BAYES_00, DATE_IN_PAST_06_12, 
 DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF,
 SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no
 version=3.4.6-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 43; hammy, 150; neutral, 217; spammy,
 0. spammytokens: hammytokens:0.000-+--XDebbugsCc,
 0.000-+--X-Debbugs-Cc, 0.000-+--cmake, 0.000-+--grohne, 0.000-+--Grohne
Return-path: &lt;helmut@subdivi.de&gt;
Received: from isilmar-4.linta.de ([136.243.71.142]:55374)
 by buxtehude.debian.org with esmtps
 (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.94.2) (envelope-from &lt;helmut@subdivi.de&gt;) id 1tIsas-00BlUb-5f
 for submit@bugs.debian.org; Wed, 04 Dec 2024 16:51:19 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=subdivi.de;
 s=k11.isilmar-4; t=1733331073;
 bh=XBbqEjj4bOU/Yz8cEeStcWt1HP6iOo8Dy7Ge1zMDNmc=;
 h=Date:From:To:Subject:From;
 b=Oq7B7QHpeONPH7r/819oN6/6W3OtKC072kXUmq2jhSnj7eViVjZrOorFkyAPnsgAu
 qOImQ+puXVCQcetG3XOeLgE0OD3TgYPSBTndsir9OytivXkE74zQUcch8PasdxerSj
 a2BfW0ZnWJTWXsCOAemwvDrt4d2NNGOlHFMhCMv1/tVsJ4YdnEmKYhF3XvAwrdO0oQ
 NV+k1JQLjcOKOe206atBBoN94W796rYbbhBc/L83Er5sgSapBb8nd/gO2bhkMziVaH
 lsqRR43jiAnhYHPPj5hBE2jQi0pA5VqaDHjxhQhYMxNgUlLTCDWH+M5jtpsJOkQoTZ
 p7p+NdSlBRxWQ==
Received: from isilmar-4.linta.de (isilmar.linta [10.0.0.1])
 by isilmar-4.linta.de (Postfix) with ESMTP id BD1D52000C1
 for &lt;submit@bugs.debian.org&gt;; Wed,  4 Dec 2024 16:51:13 +0000 (UTC)
Date: Wed, 4 Dec 2024 11:45:10 +0100
From: Helmut Grohne &lt;helmut@subdivi.de&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: clamav FTCBFS: unsatisfiable test dependencies
Message-ID: &lt;20241204104510.GA3752316@subdivi.de&gt;
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=&quot;wzpjIzUP91v0N2a+&quot;
Content-Disposition: inline
X-Reportbug-Version: 13.0.2
Delivered-To: submit@bugs.debian.org


--wzpjIzUP91v0N2a+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Source: clamav
Version: 1.4.1+dfsg-1
Tags: patch
User: debian-cross@lists.debian.org
Usertags: bdsat
X-Debbugs-Cc: kanashiro@debian.org

Hi,

I noticed that clamav fails to cross build from source since about two
years due to more Build-Depends. Unfortunately, building
clamav-testfiles depends on enabling unit tests. Thus I propose to
disable testing in arch-only builds with DEB_BUILD_OPTIONS=nocheck but
leave testing enabled in all other build configurations (in particular
in all buildd builds). The changed configuration is precisely the one
relevant to cross building. I verified that this change does not incur
changes to output artifacts by comparing modified builds with original
builds using diffoscope. I'm attaching the resulting patch for your
convenience. Note that it does not yet make clamav cross buildable. All
it does is get us significantly closer to actually satisfying
Build-Depends. What needs to happen next likely is annotating a couple
of Build-Depends with :native and then figure out how to avoid running
cmake/CheckSignedRightShift.cmake. That said, please close this bug when
addressing the test dependencies.

Helmut

--wzpjIzUP91v0N2a+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=&quot;clamav_1.4.1+dfsg-1.1.debdiff&quot;

diff --minimal -Nru clamav-1.4.1+dfsg/debian/changelog clamav-1.4.1+dfsg/debian/changelog
--- clamav-1.4.1+dfsg/debian/changelog	2024-10-03 10:51:50.000000000 +0200
+++ clamav-1.4.1+dfsg/debian/changelog	2024-12-04 08:26:22.000000000 +0100
@@ -1,3 +1,13 @@
+clamav (1.4.1+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Improve cross building: (Closes: #-1)
+    + Skip tests in arch-only build with DEB_BUILD_OPTIONS=nocheck.
+    + Skip doxygen in arch-only build.
+    + Demote/annotate conditional dependencies.
+
+ -- Helmut Grohne &lt;helmut@subdivi.de&gt;  Wed, 04 Dec 2024 08:26:22 +0100
+
 clamav (1.4.1+dfsg-1) unstable; urgency=medium
 
   * Import 1.4.1 (Closes: #1080962)
diff --minimal -Nru clamav-1.4.1+dfsg/debian/control clamav-1.4.1+dfsg/debian/control
--- clamav-1.4.1+dfsg/debian/control	2024-10-03 10:41:37.000000000 +0200
+++ clamav-1.4.1+dfsg/debian/control	2024-12-04 08:26:22.000000000 +0100
@@ -10,12 +10,11 @@
 Build-Depends: dpkg-dev (&gt;= 1.22.5), automake,
                bindgen,
                cargo,
-               check,
+               check &lt;!nocheck&gt;,
                cmake,
                debhelper-compat (= 12),
                dh-apparmor,
                dh-strip-nondeterminism,
-               doxygen,
                libbz2-dev,
                libcurl4-openssl-dev,
                libjson-c-dev,
@@ -30,11 +29,15 @@
                perl:native,
                pkg-config,
                po-debconf,
-               python3-pytest,
-               rust-gdb,
+               python3-pytest &lt;!nocheck&gt;,
+               rust-gdb &lt;!nocheck&gt;,
                rustfmt,
                systemd,
                zlib1g-dev
+Build-Depends-Indep: check,
+                     doxygen,
+                     python3-pytest,
+                     rust-gdb,
 Standards-Version: 4.7.0
 Rules-Requires-Root: no
 Vcs-Git: https://salsa.debian.org/clamav-team/clamav.git
diff --minimal -Nru clamav-1.4.1+dfsg/debian/rules clamav-1.4.1+dfsg/debian/rules
--- clamav-1.4.1+dfsg/debian/rules	2024-10-03 10:41:55.000000000 +0200
+++ clamav-1.4.1+dfsg/debian/rules	2024-12-04 08:26:22.000000000 +0100
@@ -33,7 +33,24 @@
 #else
    SYSTEM_LLVM := -DBYTECODE_RUNTIME=interpreter
 #endif
-#
+
+DO_PACKAGES := $(shell dh_listpackages)
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+	ENABLE_TESTS = ON
+else
+ifeq (,$(filter clamav-testfiles,$(DO_PACKAGES)))
+	ENABLE_TESTS = OFF
+else
+	ENABLE_TESTS = ON
+endif
+endif
+
+ifeq (,$(filter clamav-docs,$(DO_PACKAGES)))
+	ENABLE_DOXYGEN = OFF
+else
+	ENABLE_DOXYGEN = ON
+endif
+
 # Enable debug code, if nostrip was given.
 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 	INSTALL_PROGRAM += -s
@@ -47,7 +64,8 @@
 #	* set various paths
 CONFIG := -DENABLE_EXTERNAL_MSPACK=ON -DENABLE_UNRAR=OFF -DENABLE_EXTERNAL_TOMFASTMATH=ON \
 	-DAPP_CONFIG_DIRECTORY=/etc/clamav -DDATABASE_DIRECTORY=/var/lib/clamav \
-	-DENABLE_DOXYGEN=ON -DSYSTEMD_UNIT_DIR=/lib/systemd/system -DDO_NOT_SET_RPATH=ON \
+	-DENABLE_DOXYGEN=$(ENABLE_DOXYGEN) -DSYSTEMD_UNIT_DIR=/lib/systemd/system -DDO_NOT_SET_RPATH=ON \
+	-DENABLE_TESTS=$(ENABLE_TESTS) \
 	$(SYSTEM_LLVM) \
 	$(DEBUG_OPTS)
 

--wzpjIzUP91v0N2a+--
]