[exim-dev] [patch] exim 4.90_RC1 SOURCE_DATE_EPOCH build err…

Top Page
Delete this message
Reply to this message
Author: Andreas Metzler
Date:  
To: exim-dev
Subject: [exim-dev] [patch] exim 4.90_RC1 SOURCE_DATE_EPOCH build error / missing parts
Hello,

Thhanks 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.

Trivial patches 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 d7a9be112b313cc5d56fed5301ce73c60747d943 Mon Sep 17 00:00:00 2001
From: Andreas Metzler <ametzler@???>
Date: Sat, 28 Oct 2017 12:59:21 +0200
Subject: [PATCH 1/2] Fix build error with SOURCE_DATE_EPOCH due to typo.

---
src/scripts/reversion | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/scripts/reversion b/src/scripts/reversion
index 5e0ed855..c82d9c0a 100755
--- a/src/scripts/reversion
+++ b/src/scripts/reversion
@@ -96,7 +96,7 @@ if [ ".${SOURCE_DATE_EPOCH:-}" != "." ]; then
# builds without it causing any problems: nothing really cares about timezone.
# GNU date: "date -d @TS"
# BSD date: "date -r TS"
- exim_build_date_override="$(date -u -d "@${SOURCE_DATE_EPOCH}" "$fmt" 2>/dev/null | date -u -r "${SOURCE_DATE_EPOCH}" "$fmt" 2>/dev/null)"
+ exim_build_date_override="$(date -u -d "@${SOURCE_DATE_EPOCH}" "$fmt" 2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "$fmt" 2>/dev/null)"
fi

( echo '# automatically generated file - see ../scripts/reversion'
--
2.14.2

>From e01292d0bf44cc5ab3fcebe2abf3acaee49ccd57 Mon Sep 17 00:00:00 2001
From: Andreas Metzler <ametzler@???>
Date: Sat, 28 Oct 2017 13:01:50 +0200
Subject: [PATCH 2/2] Make exim_monitor build reproducible.

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

diff --git a/src/exim_monitor/em_version.c b/src/exim_monitor/em_version.c
index a2edbfe8..92d813ff 100644
--- a/src/exim_monitor/em_version.c
+++ b/src/exim_monitor/em_version.c
@@ -21,6 +21,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 = date_buffer;
+version_date[0] = 0;
+Ustrncat(version_date, EXIM_BUILD_DATE_OVERRIDE, sizeof(date_buffer));
+
+#else
Ustrcpy(today, __DATE__);
if (today[4] == ' ') i = 1;
today[3] = today[6] = '-';
@@ -32,6 +42,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