brotli: forcing use of qemu in arm and arm64

Maximiliano Curia <[email protected]>
Newsgroups gmane.linux.debian.devel.python
Message-ID <[email protected]>
Package: src:brotli
Version: 1.2.0-3
Severity: serious
Architecture: armhf arm64
User: [email protected]
Usertags: python3.15

Hi!

While rebuilding packages against Python 3.15 we found that brotli
failed to build from source in arm64. This issue is unrelated to Python
3.15, but instead triggered by a change in debhelper that now is
passing the -DCMAKE_C_COMPILER option, and brotli uses regular
expressions on that variable to decide that the build is being
crosscompiled, trying to use qemu (which is not a build dependency),
causing the FTBFS.

I'm attaching the patch that I'm applying in my sandbox to be able to
build the packages that depend on brotli, please consider applying a
similar patch or add qemu-user to the build dependencies in the
corresponding architectures (not ideal).

Happy hacking,
-- 
Porque no respeta el orden natural en el que se leen las cosas
> ¿Por qué contestar al principio del mensaje es malo?
Saludos /\/\ /\ >< `/
brotli_1.2.0-3.1.debdiff (text/plain, 2.7 KB)
diff -Nru brotli-1.2.0/debian/changelog brotli-1.2.0/debian/changelog
--- brotli-1.2.0/debian/changelog	2026-02-07 09:41:56.000000000 +0100
+++ brotli-1.2.0/debian/changelog	2026-08-15 19:43:27.000000000 +0200
@@ -1,3 +1,10 @@
+brotli (1.2.0-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Avoid using qemu whenever we try to build against arm64
+
+ -- Maximiliano Curia <[email protected]>  Sat, 15 Aug 2026 19:43:27 +0200
+
 brotli (1.2.0-3) unstable; urgency=medium
 
   [ Helmut Grohne ]
diff -Nru brotli-1.2.0/debian/patches/0002-only-use-qemu-test-wrapper-when-actually-cross-compiling.patch brotli-1.2.0/debian/patches/0002-only-use-qemu-test-wrapper-when-actually-cross-compiling.patch
--- brotli-1.2.0/debian/patches/0002-only-use-qemu-test-wrapper-when-actually-cross-compiling.patch	1970-01-01 01:00:00.000000000 +0100
+++ brotli-1.2.0/debian/patches/0002-only-use-qemu-test-wrapper-when-actually-cross-compiling.patch	2026-08-15 19:43:27.000000000 +0200
@@ -0,0 +1,29 @@
+From: Maximiliano Curia <[email protected]>
+Date: Sat, 15 Aug 2026 18:00:00 +0000
+Subject: Only use the qemu test wrapper when actually cross-compiling
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -231,19 +231,19 @@
+ if (NOT BROTLI_DISABLE_TESTS AND BROTLI_BUILD_TOOLS)
+   # If our compiler is a cross-compiler that we know about (arm/aarch64),
+   # then we need to use qemu to execute the tests.
+-  if ("${CMAKE_C_COMPILER}" MATCHES "^.*/arm-linux-gnueabihf-.*$")
++  if (CMAKE_CROSSCOMPILING AND "${CMAKE_C_COMPILER}" MATCHES "^.*/arm-linux-gnueabihf-.*$")
+     message(STATUS "Detected arm-linux-gnueabihf cross-compilation")
+     set(BROTLI_WRAPPER "qemu-arm")
+     set(BROTLI_WRAPPER_LD_PREFIX "/usr/arm-linux-gnueabihf")
+   endif()
+ 
+-  if ("${CMAKE_C_COMPILER}" MATCHES "^.*/arm-linux-gnueabi-.*$")
++  if (CMAKE_CROSSCOMPILING AND "${CMAKE_C_COMPILER}" MATCHES "^.*/arm-linux-gnueabi-.*$")
+     message(STATUS "Detected arm-linux-gnueabi cross-compilation")
+     set(BROTLI_WRAPPER "qemu-arm")
+     set(BROTLI_WRAPPER_LD_PREFIX "/usr/arm-linux-gnueabi")
+   endif()
+ 
+-  if ("${CMAKE_C_COMPILER}" MATCHES "^.*/aarch64-linux-gnu-.*$")
++  if (CMAKE_CROSSCOMPILING AND "${CMAKE_C_COMPILER}" MATCHES "^.*/aarch64-linux-gnu-.*$")
+     message(STATUS "Detected aarch64-linux-gnu cross-compilation")
+     set(BROTLI_WRAPPER "qemu-aarch64")
+     set(BROTLI_WRAPPER_LD_PREFIX "/usr/aarch64-linux-gnu")
diff -Nru brotli-1.2.0/debian/patches/series brotli-1.2.0/debian/patches/series
--- brotli-1.2.0/debian/patches/series	2026-02-07 09:39:12.000000000 +0100
+++ brotli-1.2.0/debian/patches/series	2026-08-15 19:43:27.000000000 +0200
@@ -1 +1,2 @@
 0001-disable-BROTLI_MODEL-macro-for-some-targets.patch
+0002-only-use-qemu-test-wrapper-when-actually-cross-compiling.patch
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE+JIdOnQEyG4RNSIVxxl2mbKbIyoFAmqBiWQACgkQxxl2mbKb
IyqFTRAAip6A/wephgoQ/I0Vfx5qcxydUYgxBgMFxRej1dREcMG1zNoIYY8KExO8
i69nHJtmgYiqep2q/cV5EU9GxY5HPNy8PrhiGEl0373DXV4p4lVm5KdyYQHki/QN
H9P5WpXthkZrCje1pETfMxtTNodya8GxgAapZnNM5X6Bm4Vo1R4R98H9oO0pbTGo
ZrnfAot3eRh01JMytEkcXUZt5OO8ioee2qC1IDPrAfKgtfxz93DkpUXiUHzlm7O7
DKz7C86eXAuLl4vYFIPzpZcOOUrisz27KqDfG0T8cbg8BDDd0fnBIZF+iu6ggn9V
x5/x3FK6N+KEaPKt/4ZId4jakznEWvsuITtihTX9yrkxiTG+EYfpOWVjxmlGO9Gg
gnRaqx6HaxmCyEkOHxmSvdQRRTP6Dtu2a8EBUYt7UMQ4ohWjuSt2dvnp1gjZfuue
p8G8M+nMrhVKRXCSKN65SaQDUp3yrfpPyoghv0yejaELN+vOWx+GIbh3KYIznbBq
kFGNwHOBygqJ2QX+bJvgEuQREyiWnlxb79wy6mcrZsVSe/2FQD385c3/dvNa2uO7
BvWnJCGYPrWnNA0UGU6+OIG9LalnmzeSqx7v0hT4Jw+bEU/CjDjwpwqf8cSfbHKW
mX4muzFOxA4MZDUdXdvkoA7BWCIXZN1Mx4jl8Fs0XiF/s72Yo7g=
=ZF3Q
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.