Debian Bug report logs - #1029801
tbox: reproducible builds: timestamp embedded in tbox.config.h

Package: src:tbox; Maintainer for src:tbox is Yangfl <mmyangfl@gmail.com>;

Reported by: Vagrant Cascadian <vagrant@reproducible-builds.org>

Date: Fri, 27 Jan 2023 23:00:02 UTC

Severity: normal

Tags: patch

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Yangfl <mmyangfl@gmail.com>:
Bug#1029801; Package src:tbox. (Fri, 27 Jan 2023 23:00:04 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
New Bug report received and forwarded. Copy sent to reproducible-bugs@lists.alioth.debian.org, Yangfl <mmyangfl@gmail.com>. (Fri, 27 Jan 2023 23:00:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: submit@bugs.debian.org
Subject: tbox: reproducible builds: timestamp embedded in tbox.config.h
Date: Fri, 27 Jan 2023 14:57:29 -0800
[Message part 1 (text/plain, inline)]
Source: tbox
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs@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
[0001-configure-Use-determistic-timestamp-from-SOURCE_DATE.patch (text/x-diff, inline)]
From 83994f9a353d7ebb0c61cf426aeaa033a5042a07 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@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

[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed May 17 10:59:09 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.