Package: lush
Version: 1.2.1-9+cvs20110227+nmu1
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
Tags: patch

Lush fails to build reproducibly in part because it embeds the timestamp
of the build.

see: 
https://reproducible.debian.net/dbd/unstable/amd64/lush_1.2.1-9+cvs20110227+nmu1.debbindiff.html

The attached patch avoids this by omitting LUSH_DATE and LUSH_TIME
entirely (which would happen even if __DATE__ and __TIME__ were not
available from the C preprocessor).

Regards,

        --dkg

>From 9532edb4460f0ec3563295113757c3f9c673e11f Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <d...@fifthhorseman.net>
Date: Wed, 3 Jun 2015 14:51:42 -0400
Subject: [PATCH] reproducibility: avoid including __DATE__ and __TIME__

Avoid including __DATE__ and __TIME__ in the build process.

This makes the binary package easier to reproduce reliably from
source.

See:

https://wiki.debian.org/ReproducibleBuilds/TimestampsFromCPPMacros
---
 lsh/manual/miscellaneous.hlp | 2 --
 src/main.c                   | 3 ---
 src/unix.c                   | 6 ------
 3 files changed, 11 deletions(-)

diff --git a/lsh/manual/miscellaneous.hlp b/lsh/manual/miscellaneous.hlp
index fe59b50..e9706cb 100644
--- a/lsh/manual/miscellaneous.hlp
+++ b/lsh/manual/miscellaneous.hlp
@@ -572,8 +572,6 @@ e.g. <"so"> or <"sl"> or <"dll">.
 The major version of Lush specified in loadable modules.
 .IP <"LUSH_MINOR">
 The minor version of Lush specified in loadable modules.
-.IP <"LUSH_DATE">
-The date lush was compiled.
 
 #? (getenv <s>)
 Returns the value of the environment variable whose name is <s>.
diff --git a/src/main.c b/src/main.c
index e540860..ebf1957 100644
--- a/src/main.c
+++ b/src/main.c
@@ -57,9 +57,6 @@ main(int argc, char **argv)
     {
       FMODE_TEXT(stderr);
       fprintf(stderr,"LUSH Lisp Universal Shell"
-#ifdef __DATE__
-              " (compiled on " __DATE__ ")"
-#endif
               "\n");
       fprintf(stderr,
               "   Copyright (C) 2002 Leon Bottou, Yann LeCun, AT&T, NECI.\n"
diff --git a/src/unix.c b/src/unix.c
index 612cfe6..d71a5d1 100644
--- a/src/unix.c
+++ b/src/unix.c
@@ -1398,12 +1398,6 @@ DX(xgetconf)
   static struct { char *k,*v; } confdata[] = {
     { "LUSH_MAJOR", enclose_in_string(LUSH_MAJOR) },
     { "LUSH_MINOR", enclose_in_string(LUSH_MINOR) },
-#ifdef __DATE__
-    { "LUSH_DATE", __DATE__ },
-#endif
-#ifdef __TIME__
-    { "LUSH_TIME", __TIME__ },
-#endif
     LUSH_MAKE_MACROS,
     { 0, 0 } 
   };
-- 
2.1.4

Reply via email to