Source: last-align
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: cpu
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Various manpages embed the relevent SIMD variant of the CPU used in the
build environment:

  
https://tests.reproducible-builds.org/debian/rb-pkg/bookworm/i386/last-align.html

  /usr/share/man/man1/last-merge-batches.1.gz

  .B·last-merge-batches-avx
vs.
  .B·last-merge-batches-avx2

The attached patch to debian/rules and debian/bin/dispatch-simd creates
an environment variable, SIMD_LIST, which is set in debian/rules to
ensure none of the variants match, falling back to the "plain" variants.

Another option might be to postprocess the manpage...


With this patch applied, last-align should at least build reproducibly
on tests.reproducible-builds.org once it migrates to bookworm/testing,
as build paths are currently only varied in unstable and experimental
which trigger other reproducibility issues.


Thanks for maintaining last-align!


live well,
  vagrant
From 6fe1d0e3cfe3efd8f9bc5c1a3ffcd7ea84316352 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Sun, 9 Jan 2022 05:43:58 +0000
Subject: [PATCH] debian/rules, simd-dispatch: Pass an environment variable to
 use the plain variant to when building manpages with help2man.

The relevent simd variant of the build environment is embedded in the
manpage, breaking build reproducibility depending on the cpu features
of the running build environment.
---
 debian/bin/simd-dispatch | 3 ++-
 debian/rules             | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/debian/bin/simd-dispatch b/debian/bin/simd-dispatch
index aa3bef8..5faf6b2 100755
--- a/debian/bin/simd-dispatch
+++ b/debian/bin/simd-dispatch
@@ -14,7 +14,8 @@ function test_and_run () {
 	fi
 }
 
-for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 sse mmx ; do test_and_run ${SIMD} "$@" ; done
+SIMD_LIST=${SIMD_LIST:-"avx2 avx sse4.1 ssse3 sse3 sse2 sse mmx"}
+for SIMD in $SIMD_LIST ; do test_and_run ${SIMD} "$@" ; done
 
 # fallback to plain option
 $BASE-plain "$@"
diff --git a/debian/rules b/debian/rules
index 2812ffd..73bfc74 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,6 +22,10 @@ export DEB_LDFLAGS_MAINT_APPEND += -pthread
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
+# Ensure the COMMAND-plain variants is used to generate the manpages
+# for reproducible builds
+export SIMD_LIST = fallback-to-plain-simd
+
 BUILT_USING=$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W "libsimde-dev")
 
 %:
-- 
2.34.1

Attachment: signature.asc
Description: PGP signature

Reply via email to