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

The build time is embedded in /usr/include/tbox/tbox.config.h:

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

  /usr/include/tbox/tbox.config.h

  #define·TB_CONFIG_VERSION_BUILD·20240228
  vs.
  #define·TB_CONFIG_VERSION_BUILD·20230127

The attached patch to configure fixes this by calling date with
arguments to ensure a deterministic timestamp, falling back to the
default behavior.

According to my local tests, with this patch applied, tbox should
build reproducibly on tests.reproducible-builds.org!

Thanks for maintaining tbox!

live well,
  vagrant
From 83994f9a353d7ebb0c61cf426aeaa033a5042a07 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Fri, 27 Jan 2023 22:42:17 +0000
Subject: [PATCH] configure: Use determistic timestamp from SOURCE_DATE_EPOCH
 if available.

This supports multiple date implementations, falling back to the
current behavior on failure.
---
 configure | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index a0f42ae..9c9163a 100755
--- a/configure
+++ b/configure
@@ -253,8 +253,10 @@ _os_find() {
 }
 
 # get date, "%Y%m%d%H%M" -> 202212072222
+# Use deterministic timestamp from SOURCE_DATE_EPOCH if available
+# https://reproducible-builds.org/docs/source-date-epoch/
 _os_date() {
-    _ret=$(date +"${1}")
+    _ret=$(date -u -d "@$SOURCE_DATE_EPOCH" +"${1}" || date -u -r "$SOURCE_DATE_EPOCH" +"${1}" || date +"${1}")
 }
 
 # we avoid use `basename`, because it's slow
-- 
2.39.1

Attachment: signature.asc
Description: PGP signature

Reply via email to