Skip to content

Commit e7c5eb5

Browse files
authored
Use RELEASE_NOTES date instead of build date
Use `RELEASE_NOTES` 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. Alternatively, https://reproducible-builds.org/docs/source-date-epoch/#makefile could be implemented. This patch was done while working on reproducible builds for openSUSE, sponsored by the NLnet NGI0 fund.
1 parent cfec602 commit e7c5eb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ else
2424
DEB_PACKAGE_NAME := $(BINARY_NAME)
2525
endif
2626

27-
DATE := $(shell date -u '+%Y-%m-%d-%H%M UTC')
27+
DATE := $(shell date -u -r RELEASE_NOTES '+%Y-%m-%d-%H%M UTC')
2828
VERSION_FLAGS := -X "main.Version=$(VERSION)" -X "main.BuildTime=$(DATE)"
2929
ifdef PACKAGE_MANAGER
3030
VERSION_FLAGS := $(VERSION_FLAGS) -X "github.com/cloudflare/cloudflared/cmd/cloudflared/updater.BuiltForPackageManager=$(PACKAGE_MANAGER)"

0 commit comments

Comments
 (0)