Skip to content

Commit

Permalink
fix: let util/mkbuildinf.pl use SOURCE_DATE_EPOCH, even if it's zero
Browse files Browse the repository at this point in the history
Doing this allows reproducible builds, for those who want this.

Fixes openssl#25475

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Tom Cosgrove <[email protected]>
(Merged from openssl#25699)
  • Loading branch information
levitte committed Oct 17, 2024
1 parent 6bb62ab commit 7b36037
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util/mkbuildinf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
my ($cflags, $platform) = @ARGV;
$cflags = "compiler: $cflags";

my $date = gmtime($ENV{'SOURCE_DATE_EPOCH'} || time()) . " UTC";
# Use the value of the envvar SOURCE_DATE_EPOCH, even if it's
# zero or the empty string.
my $date = gmtime($ENV{'SOURCE_DATE_EPOCH'} // time()) . " UTC";

print <<"END_OUTPUT";
/*
Expand Down

0 comments on commit 7b36037

Please sign in to comment.