From a6525142b96ebb2f3640fb8e8fb25250eb2ad226 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Wed, 27 May 2026 13:35:11 +0200 Subject: [PATCH] functions: Set SOURCE_DATE_EPOCH from core's HEAD commit timestamp Mirrors what build-in-container-inner.sh already does, so CI builds that invoke the build scripts directly also produce reproducible artifacts. Ticket: ENT-14061 Signed-off-by: Lars Erik Wik --- build-scripts/functions | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build-scripts/functions b/build-scripts/functions index 769b8f55c..3f19b7a92 100644 --- a/build-scripts/functions +++ b/build-scripts/functions @@ -796,4 +796,11 @@ log_error() { echo "$(basename "$0"): error:" "$@" >&2 } +# Pin embedded build timestamps so two builds of the same source produce identical binaries. +if [ -z "$SOURCE_DATE_EPOCH" ] && [ -d "$BASEDIR/core/.git" ]; then + SOURCE_DATE_EPOCH=$(git -C "$BASEDIR/core" log -1 --format=%ct) + export SOURCE_DATE_EPOCH + log_info "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" +fi + _IS_FUNCTIONS_SOURCED=yes