Package: mapsembler2
Severity: normal
Tags: patch
User: [email protected]
Usertags: timestamps kernel uname
X-Debbugs-Cc: [email protected]

The timestamp and running kernel version are embedded at least one of
the binaries shipped in mapsembler2:

│ │ ├── ./usr/bin/mapsembler2_extremities
...
│ │ │ │ -Linux-6.12.115+deb13.1-amd64
│ │ │ │ -2026-11-09 16:12:37
│ │ │ │ +Linux-6.12.116+deb13-amd64
│ │ │ │ +2026-11-12 02:41:39

This is currently confirmed by both reproduce.debian.net and 
tests.reproducible-builds.org:

https://reproduce.debian.net/excuses.html?source_name=mapsembler2

https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/mapsembler2.html

The attached patches fix this by using CMAKE_SYSTEM_NAME instead of
CMAKE_SYSTEM to avoid embedding the kernel version, and using the CMake
TIMESTAMP macro which respects the SOURCE_DATE_EPOCH environment
variable.

I believe with these patches applied, mapsembler2 should build
reproducibly!

Thanks for maintaining mapsembler2!

live well,
  vagrant
From 5ccc00aec48888812efc119ed5bf251f426870b3 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <[email protected]>
Date: Thu, 12 Nov 2026 15:27:48 -0800
Subject: [PATCH 1/2] Use CMAKE_SYSTEM_NAME to Avoid embedding running kernel
 version.

https://tests.reproducible-builds.org/debian/issues/unstable/captures_kernel_version_via_CMAKE_SYSTEM_issue.html
---
 .../thirdparty/gatb-core/src/gatb/system/api/config.hpp.in      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mapsembler2_extremities/thirdparty/gatb-core/src/gatb/system/api/config.hpp.in b/mapsembler2_extremities/thirdparty/gatb-core/src/gatb/system/api/config.hpp.in
index 9266b7b..e228e9a 100644
--- a/mapsembler2_extremities/thirdparty/gatb-core/src/gatb/system/api/config.hpp.in
+++ b/mapsembler2_extremities/thirdparty/gatb-core/src/gatb/system/api/config.hpp.in
@@ -24,7 +24,7 @@
 #define STR_COMPILATION_FLAGS   "${gatb-core-flags}"
 #define STR_COMPILER            "${CMAKE_C_COMPILER}  (${CMAKE_CXX_COMPILER_VERSION})"
 
-#define STR_OPERATING_SYSTEM    "${CMAKE_SYSTEM}"
+#define STR_OPERATING_SYSTEM    "${CMAKE_SYSTEM_NAME}"
 
 #define KSIZE_1  ${KSIZE_1}
 #define KSIZE_2  ${KSIZE_2}
-- 
2.47.3

From 29810741f3357244590d0f5a5aefd579d80c0e3c Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <[email protected]>
Date: Thu, 12 Nov 2026 15:42:56 -0800
Subject: [PATCH 2/2] gatb-core/CMakeLists.txt: Use TIMESTAMP to set
 gatb-core-date.

---
 mapsembler2_extremities/thirdparty/gatb-core/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mapsembler2_extremities/thirdparty/gatb-core/CMakeLists.txt b/mapsembler2_extremities/thirdparty/gatb-core/CMakeLists.txt
index a701356..5772bbe 100644
--- a/mapsembler2_extremities/thirdparty/gatb-core/CMakeLists.txt
+++ b/mapsembler2_extremities/thirdparty/gatb-core/CMakeLists.txt
@@ -39,7 +39,9 @@ include (GetDate)
 DefineInteger (k)
 
 # We get the current date
-GetCurrentDate (gatb-core-date) 
+# Use TIMESTAMP, which respects SOURCE_DATE_EPOCH if set:
+# https://reproducible-builds.org/docs/source-date-epoch/
+string (TIMESTAMP gatb-core-date "%Y-%m-%d %H:%M:%S" UTC)
 
 ################################################################################
 # COMPILER DEFINITIONS
-- 
2.47.3

Attachment: signature.asc
Description: PGP signature

Reply via email to