From 7f6b34f8d9c90075db8cc3a3c9d82efd88f85f24 Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Mon, 8 Jul 2024 10:24:19 +0200 Subject: [PATCH] Use ChangeLog date instead of build date to make builds reproducible. 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. This date call only works with GNU date and BSD date. This patch was done while working on reproducible builds for openSUSE, sponsored by the NLnet NGI0 fund. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1961f03d..d78a7dc0 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ else DEB_PACKAGE_NAME := $(BINARY_NAME) endif -DATE := $(shell date -u '+%Y-%m-%d-%H%M UTC') +DATE := $(shell date -u -r RELEASE_NOTES '+%Y-%m-%d-%H%M UTC') VERSION_FLAGS := -X "main.Version=$(VERSION)" -X "main.BuildTime=$(DATE)" ifdef PACKAGE_MANAGER VERSION_FLAGS := $(VERSION_FLAGS) -X "github.com/cloudflare/cloudflared/cmd/cloudflared/updater.BuiltForPackageManager=$(PACKAGE_MANAGER)"