]> git.ipfire.org Git - thirdparty/openwrt.git/commit
build: derive PKG_SOURCE_DATE_EPOCH from the unpacked source tree 23576/head
authorPaul Spooren <mail@aparcar.org>
Sat, 30 May 2026 09:16:08 +0000 (11:16 +0200)
committerPaul Spooren <mail@aparcar.org>
Tue, 2 Jun 2026 09:51:00 +0000 (11:51 +0200)
commite36c2946b7b574504335ff517b19b7c1eedf1bd8
tree7838223e7738a734c390bc868adc7002d84e47ec
parentd93c6d9a490984927b950c102893763ae7720717
build: derive PKG_SOURCE_DATE_EPOCH from the unpacked source tree

Previously PKG_SOURCE_DATE_EPOCH came from a git log on the OpenWrt
package directory. That fails in shallow feed clones and in the SDK
(no .git), collapsing to the script's mtime and breaking .apk
reproducibility across SDK rebuilds and between buildbot and SDK.

With this comment, PKG_UNPACK generates a version.date file, later used to
determine a reproducible SOURCE_DATE_EPOCH. Since unpack happens after
download, the evaluation of SOURCE_DATE_EPOCH is now lazy, invoking the
`get_source_date_epoch.sh` script on every use.

While at it, drop export of PKG_SOURCE_DATE_EPOCH and clean it from the
ipkg-build script.

Link: https://github.com/openwrt/openwrt/issues/21579
Link: https://github.com/openwrt/openwrt/pull/21587
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/23576
Signed-off-by: Paul Spooren <mail@aparcar.org>
include/package-defaults.mk
include/package-pack.mk
include/package.mk
scripts/ipkg-build