Skip to content

Commit f1fbbf2

Browse files
committed
configure: follow reproducible-builds spec for SOURCE_DATE_EPOCH
When SOURCE_DATE_EPOCH is set, it contains a unix timestamp to be used in place of the current datetime during builds to allow bit-for-bit reproducible builds to be produced. See also: https://reproducible-builds.org/docs/source-date-epoch/ https://reproducible-builds.org/specs/source-date-epoch/
1 parent 16f852a commit f1fbbf2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

configure

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,10 @@ set_default_version()
19131913
echo "${script_name}: determining default version string."
19141914

19151915
# Use what's in the version file as-is.
1916-
version="AOCL-BLAS $(cat "${version_file}") Build $(date +%Y%m%d)"
1916+
DATE_FMT="+%Y%m%d"
1917+
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
1918+
BUILD_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u "$DATE_FMT")
1919+
version="AOCL-BLAS $(cat "${version_file}") Build ${BUILD_DATE}"
19171920
}
19181921

19191922

0 commit comments

Comments
 (0)