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