Skip to content

Commit

Permalink
Disable storing build date and time when SOURCE_DATE_EPOCH is defined (
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Jan 3, 2024
1 parent 1be90c1 commit 5bfcc2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cnf/gap-version-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,9 @@ fi
test "$VN" = "$VC" || {
echo >&2 "GAP_BUILD_VERSION = $VN"
echo "GAP_BUILD_VERSION = $VN" >$GVF
echo "GAP_BUILD_DATETIME = $(date '+%Y-%m-%d %H:%M:%S%z')" >>$GVF
if [ -z "$SOURCE_DATE_EPOCH" ]; then
echo "GAP_BUILD_DATETIME = $(date '+%Y-%m-%d %H:%M:%S%z')" >>$GVF
else
echo "GAP_BUILD_DATETIME = reproducible" >>$GVF
fi
}
2 changes: 2 additions & 0 deletions lib/init.g
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@ BindGlobal( "ShowKernelInformation", function()
if GAPInfo.Date <> "today" then
sysdate := " of ";
Append(sysdate, GAPInfo.Date);
elif GAPInfo.BuildDateTime = "reproducible" then
sysdate := "";
else
sysdate := " built on ";
Append(sysdate, GAPInfo.BuildDateTime);
Expand Down
3 changes: 2 additions & 1 deletion src/version.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const char * SyBuildVersion = "@GAP_BUILD_VERSION@";
*V SyBuildDateTime . . . . . . . . . . date and time the build was compiled
**
** 'SyBuildDateTime' is set to something like "2020-01-30 09:48:08", with
** the value given in local time.
** the value given in local time, or 'reproducible' if GAP was built without
** a build time, to create a reproducible executable.
*/
const char * SyBuildDateTime = "@GAP_BUILD_DATETIME@";

0 comments on commit 5bfcc2c

Please sign in to comment.