summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2017-11-05 10:14:56 +0100
committerPeter Korsgaard <peter@korsgaard.com>2017-11-05 11:43:19 +0100
commit0437d2f8f6ef8c10b529c154f4534453ce34607b (patch)
treef6daa59d04e851b221ec9a8110c91b3cdfa9ecb1 /Makefile
parent89d525186161d4651366379ac21e80eead6a754e (diff)
downloadbuildroot-0437d2f8f6ef8c10b529c154f4534453ce34607b.tar.gz
buildroot-0437d2f8f6ef8c10b529c154f4534453ce34607b.zip
core/reproducible: do not override SOURCE_DATE_EPOCH
SOURCE_DATE_EPOCH is currently forcibly set (to either the git commit date, or the last release date). However, the spec mandates that it should not be modified if already set: https://reproducible-builds.org/specs/source-date-epoch/ Build systems MUST NOT overwrite this variable for child processes to consume if it is already present. Abide by the rule, and only set it if not already set. This will allow users to pass it from an upper-layer buildsystem (e.g. a jenkins or gitlab-ci job, for example), when they have a reson to do so. Reported-by: Peter Korsgaard <peter@korsgaard.com> Reported-by: Einar Jón Gunnarsson <tolvupostur@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Peter Korsgaard <peter@korsgaard.com> Cc: Einar Jón Gunnarsson <tolvupostur@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 79db7fe48a..7a727075ea 100644
--- a/Makefile
+++ b/Makefile
@@ -254,7 +254,7 @@ export LANG = C
export LC_ALL = C
export GZIP = -n
BR2_VERSION_GIT_EPOCH = $(shell GIT_DIR=$(TOPDIR)/.git $(GIT) log -1 --format=%at)
-export SOURCE_DATE_EPOCH = $(if $(wildcard $(TOPDIR)/.git),$(BR2_VERSION_GIT_EPOCH),$(BR2_VERSION_EPOCH))
+export SOURCE_DATE_EPOCH ?= $(if $(wildcard $(TOPDIR)/.git),$(BR2_VERSION_GIT_EPOCH),$(BR2_VERSION_EPOCH))
DEPENDENCIES_HOST_PREREQ += host-fakedate
endif
OpenPOWER on IntegriCloud