Re: [exim-dev] [patch] exim 4.90_RC1 SOURCE_DATE_EPOCH build…

Góra strony
Delete this message
Reply to this message
Autor: Andreas Metzler
Data:  
Dla: exim-dev
Temat: Re: [exim-dev] [patch] exim 4.90_RC1 SOURCE_DATE_EPOCH build error / missing parts
On 2017-10-28 Phil Pennock <pdp@???> wrote:
> On 2017-10-28 at 13:08 +0200, Andreas Metzler wrote:
> > Thanks for introducing SOURCE_DATE_EPOCH support to exim. Due to a typo
> > 4.90_RC1 FTBFS with non-BSD date if SOURCE_DATE_EPOCH is set. Also the
> > change applied to exim needs to be copied over to exim_monitor.


> You're welcome, and sorry. I neglected to become a heathen using
> non-BSD date in testing. ;)


> I don't have any X11 systems (and haven't had for years) so testing the
> monitor changes would be problematic here. I _suspect_ that to fix the
> missing vars it's sufficient to just `#include "version.h"` at the top
> of em_version.c because the build system symlinks the monitor source
> files into the same build-foo dir as the Exim source files.

[...]

That is one part, the other one is that the output needs to be stored
somewhere else since the version setting code is just /almost/
identical.

Try2 attached.

cu Andreas

--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
>From f0bcc8c1b9a957d2a891da91e0c237440fca3b1b Mon Sep 17 00:00:00 2001
From: Andreas Metzler <ametzler@???>
Date: Sat, 28 Oct 2017 19:45:30 +0200
Subject: [PATCH] Make exim_monitor build reproducible.

Adapt changes to exim for SOURCE_DATE_EPOCH from exim
6e411084a29a7658f7bc88aa5a62ab9016c22c79 to exim_monitor.
---
src/exim_monitor/em_version.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/src/exim_monitor/em_version.c b/src/exim_monitor/em_version.c
index a2edbfe8..8228f946 100644
--- a/src/exim_monitor/em_version.c
+++ b/src/exim_monitor/em_version.c
@@ -10,6 +10,8 @@
#include <string.h>
#include <stdlib.h>

+#include "version.h"
+
extern uschar *version_string;
extern uschar *version_date;

@@ -21,6 +23,16 @@ uschar today[20];

version_string = US"2.06";

+#ifdef EXIM_BUILD_DATE_OVERRIDE
+/* Reproducible build support; build tooling should have given us something looking like
+ * "25-Feb-2017 20:15:40" in EXIM_BUILD_DATE_OVERRIDE based on $SOURCE_DATE_EPOCH in environ
+ * per <https://reproducible-builds.org/specs/source-date-epoch/>
+ */
+version_date = US malloc(32);
+version_date[0] = 0;
+Ustrncat(version_date, EXIM_BUILD_DATE_OVERRIDE, 31);
+
+#else
Ustrcpy(today, __DATE__);
if (today[4] == ' ') i = 1;
today[3] = today[6] = '-';
@@ -32,6 +44,7 @@ Ustrncat(version_date, today, 4);
Ustrncat(version_date, today+7, 4);
Ustrcat(version_date, " ");
Ustrcat(version_date, __TIME__);
+#endif
}

/* End of em_version.c */
--
2.14.2