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

SOURCE_DATE_EPOCH Value of 0 Does Not Override Date #25475

Closed
ajortega8 opened this issue Sep 16, 2024 · 1 comment
Closed

SOURCE_DATE_EPOCH Value of 0 Does Not Override Date #25475

ajortega8 opened this issue Sep 16, 2024 · 1 comment
Labels
branch: master Merge to master branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 branch: 3.2 Merge to openssl-3.2 branch: 3.3 Merge to openssl-3.3 branch: 3.4 Merge to openssl-3.4 triaged: bug The issue/pr is/fixes a bug

Comments

@ajortega8
Copy link

ajortega8 commented Sep 16, 2024

I discovered this on OpenSSL version 1.1.1d, but it is present in the latest master branch as well. The issue is that if you use a SOURCE_DATE_EPOCH value of 0, the test in util/mkbuildinf.pl will always grab the current time. Setting SOURCE_DATE_EPOCH to a value of 0 is useful for other projects that use it to disable certain timestamp inclusions in their compiled binaries to generate reproducible builds.

This issue was introduced by this commit:

8a8d9e1#diff-60728b88cb2b16f42e41cee0c1ca3c632f2f951619d6b26dac54d2bd38e39958

Something like this could work:

my $source_date_epoch = $ENV{'SOURCE_DATE_EPOCH'};

my $date="";
if (defined $source_date_epoch){
    $date = gmtime($source_date_epoch);
}
else{
    $date = gmtime(time());
}
$date .= " UTC";
@ajortega8 ajortega8 added the issue: bug report The issue was opened to report a bug label Sep 16, 2024
@levitte levitte added branch: master Merge to master branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch triaged: bug The issue/pr is/fixes a bug branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 branch: 3.2 Merge to openssl-3.2 branch: 3.3 Merge to openssl-3.3 branch: 3.4 Merge to openssl-3.4 labels Oct 15, 2024
levitte added a commit to levitte/openssl that referenced this issue Oct 15, 2024
Doing this allows reproducible builds, for those who want this.

Fixes openssl#25475
@levitte levitte removed the issue: bug report The issue was opened to report a bug label Oct 15, 2024
@levitte
Copy link
Member

levitte commented Oct 15, 2024

Have a look at #25699, it should do it right

openssl-machine pushed a commit that referenced this issue Oct 17, 2024
Doing this allows reproducible builds, for those who want this.

Fixes #25475

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Tom Cosgrove <[email protected]>
(Merged from #25699)

(cherry picked from commit 7b36037)
openssl-machine pushed a commit that referenced this issue Oct 17, 2024
Doing this allows reproducible builds, for those who want this.

Fixes #25475

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Tom Cosgrove <[email protected]>
(Merged from #25699)

(cherry picked from commit 7b36037)
openssl-machine pushed a commit that referenced this issue Oct 17, 2024
Doing this allows reproducible builds, for those who want this.

Fixes #25475

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Tom Cosgrove <[email protected]>
(Merged from #25699)

(cherry picked from commit 7b36037)
openssl-machine pushed a commit that referenced this issue Oct 17, 2024
Doing this allows reproducible builds, for those who want this.

Fixes #25475

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Tom Cosgrove <[email protected]>
(Merged from #25699)

(cherry picked from commit 7b36037)
openssl-machine pushed a commit that referenced this issue Oct 17, 2024
Doing this allows reproducible builds, for those who want this.

Fixes #25475

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Tom Cosgrove <[email protected]>
(Merged from #25699)

(cherry picked from commit 7b36037)
bernd-edlinger pushed a commit to bernd-edlinger/openssl that referenced this issue Oct 25, 2024
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)

(cherry picked from commit 7b36037)
coolshrid pushed a commit to coolshrid/openssl that referenced this issue Nov 9, 2024
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 branch: 3.2 Merge to openssl-3.2 branch: 3.3 Merge to openssl-3.3 branch: 3.4 Merge to openssl-3.4 triaged: bug The issue/pr is/fixes a bug
Projects
None yet
2 participants