Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions build-scripts/functions
Original file line number Diff line number Diff line change
Expand Up @@ -796,4 +796,22 @@ log_error() {
echo "$(basename "$0"): error:" "$@" >&2
}

# Pin embedded build timestamps so two builds of the same source produce identical binaries.
# In bootstrap-pr we derive it from core's HEAD commit time and persist it into
# output/ so downstream jobs (which consume the bootstrap artifacts but no
# longer have core/.git) can recover the same value.
if [ -z "$SOURCE_DATE_EPOCH" ]; then
if [ -d "$BASEDIR/core/.git" ]; then
SOURCE_DATE_EPOCH=$(git -C "$BASEDIR/core" log -1 --format=%ct)
mkdir -p "$BASEDIR/output"
echo "$SOURCE_DATE_EPOCH" > "$BASEDIR/output/SOURCE_DATE_EPOCH"
elif [ -f "$BASEDIR/output/SOURCE_DATE_EPOCH" ]; then
SOURCE_DATE_EPOCH=$(cat "$BASEDIR/output/SOURCE_DATE_EPOCH")
fi
if [ -n "$SOURCE_DATE_EPOCH" ]; then
export SOURCE_DATE_EPOCH
log_info "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH"
fi
fi

_IS_FUNCTIONS_SOURCED=yes
Loading