Page MenuHomePhabricator

Allow to override build date
ClosedPublic

Authored by bmwiedemann on Jul 13 2017, 1:23 PM.

Details

Summary

Allow to override build date
for distribution packages that use autoreconf
to recreate the configure script

See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Note: This patch will work with GNU date. If BSD date support is
important, a more complex patch needs to be done.

http://rb.zq1.de/compare.factory-20170713/efl-compare.out
also shows other diffs in .edj files that still remain

@fix

T5495

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bmwiedemann created this revision.Jul 13 2017, 1:23 PM

We support FreeBSD, OpenBSD and OSX for efl. Not sure which variant of date they use but I fear we might need the more compex version which also supports BSD date.

@netstar could you try this patch on OpenBSD? @jayji could you try on OSX?

hi, on server;

OpenBSD haxlab.members.linode.com 6.1 GENERIC#19 amd64
$ (git log --format=%ci -1 2>/dev/null || date -u -d@${SOURCE_DATE_EPOCH:-$(date +%s)} "+%Y-%m-%d %H:%M:%S %z") | tr -d '\n'
2017-08-02 23:24:17 +0100$

OpenBSD above seems to work, below FreeBSD, similar output.

FreeBSD Beastie 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
$  (git log --format=%ci -1 2>/dev/null || date -u -d@${SOURCE_DATE_EPOCH:-$(date +%s)} "+%Y-%m-%d %H:%M:%S %z") | tr -d '\n'
2017-08-05 10:12:55 +0100$

@netstar thanks for the quick test!

I will give this a run here and I think we can out it in. If any further problem comes up we can re-visit this.

This revision was automatically updated to reflect the committed changes.
jayji added a comment.Aug 7 2017, 2:11 PM

Hi, seems to work fine on macOS 10.12 as well:

(git log --format=%ci -1 2>/dev/null || date -u -d@${SOURCE_DATE_EPOCH:-$(date +%s)} "+%Y-%m-%d %H:%M:%S %z") | tr -d '\n'
2017-08-07 10:42:45 -0700