Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable storing build date and time when SOURCE_DATE_EPOCH is defined (beneficial for reproducible builds) #5551

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
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
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 @@
if GAPInfo.Date <> "today" then
sysdate := " of ";
Append(sysdate, GAPInfo.Date);
elif GAPInfo.BuildDateTime = "reproducible" then
sysdate := "";

Check warning on line 442 in lib/init.g

View check run for this annotation

Codecov / codecov/patch

lib/init.g#L442

Added line #L442 was not covered by tests
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@";