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

Allow to override build date with SOURCE_DATE_EPOCH #81

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bmwiedemann
Copy link

Allow to override build date with SOURCE_DATE_EPOCH in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

This patch allows openSUSE's resteasy package to build more reproducibly.

Without this patch, there were such diffs:

+++ /usr/share/javadoc/resteasy/org/jboss/resteasy/client/jaxrs/i18n/LogMessages_$logger.html       2020-05-09 00:52:40.125364506 +0000
@@ -143,7 +143,7 @@
 </dl>
 <hr>
 <pre><a href="https://docs.oracle.com/javase/7/docs/api/javax/annotation/Generated.html?is-external=true" title="class or interface in javax.annotation" class="externalLink">@Generated</a>(<a href="https://docs.oracle.com/javase/7/docs/api/javax/annotation/Generated.html?is-external=true#href_anchor" title="class or interface in javax.annotation" class="externalLink">value</a>="org.jboss.logging.processor.generator.model.MessageLoggerImplementor",
-           <a href="https://docs.oracle.com/javase/7/docs/api/javax/annotation/Generated.html?is-external=true#href_anchor" title="class or interface in javax.annotation" class="externalLink">date</a>="2020-05-09T00:51:48+0000")
+           <a href="https://docs.oracle.com/javase/7/docs/api/javax/annotation/Generated.html?is-external=true#href_anchor" title="class or interface in javax.annotation" class="externalLink">date</a>="2020-05-09T00:53:02+0000")

This PR was done while working on reproducible builds for openSUSE.

in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

This patch allows openSUSE's resteasy package to build more reproducibly.
@jamezp
Copy link
Member

jamezp commented Jun 8, 2021

Sorry this is over a year late, but I just noticed this PR. Is there a reason for this? Seems odd to me.

@bmwiedemann
Copy link
Author

Hi. https://reproducible-builds.org/docs/buy-in/ lists several good reasons for wanting deterministic build results.
Ideally we want to be able to get identical results anytime anywhere (given the right build-env)

@jamezp
Copy link
Member

jamezp commented Jun 9, 2021

While I understand the reasoning I don't think we should allow for the date to be overridden. We could however leave the date off, e.g. return an empty string. Manipulating the actual date seems wrong to me though.

@bmwiedemann
Copy link
Author

Sure, if there is nothing that expects the date to exist, omitting it can also work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants