[Openvpn-devel,2/2] Reduce usage of __DATE__

Message ID 20220804150301.62856-2-frank@lichtenheld.com
State Accepted
Headers show
Series [Openvpn-devel,1/2] config-version.h: remove unused includes | expand

Commit Message

Frank Lichtenheld Aug. 4, 2022, 5:03 a.m. UTC
To increase the reproducibility of builds
we shouldn't use __DATE__. However, for
the development builds there is some demand
for leaving this in.

So as suggested by Gert Doering go for a
compromise where we only use __DATE__ if
we also include the git information. This
will remove this information from release
builds, but not from builds done directly
from the git checkout.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
---
 src/openvpn/options.c | 2 ++
 src/tapctl/main.c     | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Gert Doering Aug. 6, 2022, 12:41 a.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

I think this is a workable compromise - thanks.

Building from git gives me

  OpenVPN 2.6_git [git:master/a9b3585d606e5b57] x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] [DCO] built on Aug  6 2022

doing a "make dist" and building from the resulting tarball gives

  OpenVPN 2.6_git x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD]


Your patch has been applied to the master branch.

commit a9b3585d606e5b5717778777a4f346c8371d2698
Author: Frank Lichtenheld
Date:   Thu Aug 4 17:03:01 2022 +0200

     Reduce usage of __DATE__

     Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20220804150301.62856-2-frank@lichtenheld.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24807.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 3eae14a7..0ce3158b 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -110,7 +110,9 @@  const char title_string[] =
 #ifdef ENABLE_DCO
     " [DCO]"
 #endif
+#ifdef CONFIGURE_GIT_REVISION
     " built on " __DATE__
+#endif
 ;
 
 #ifndef ENABLE_SMALL
diff --git a/src/tapctl/main.c b/src/tapctl/main.c
index e13549bf..0724cc4d 100644
--- a/src/tapctl/main.c
+++ b/src/tapctl/main.c
@@ -41,7 +41,6 @@ 
 
 const TCHAR title_string[] =
     TEXT(PACKAGE_NAME) TEXT(" ") TEXT(PACKAGE_VERSION)
-    TEXT(" built on ") TEXT(__DATE__)
 ;
 
 static const TCHAR usage_message[] =