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

Use reproducible time stamps for Maven build artifacts #139

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

ibbem
Copy link
Collaborator

@ibbem ibbem commented Mar 21, 2024

Unfortunately, JAR files store time stamps of the files inside them.
These time stamps depend on the build time of these files hence breaking
bit for bit reproducibility. By setting all time stamps to a predefined
value and removing superfluous build artifacts this issue can be
avoided. Conventionally, UNIX time stamp 1 signifies an intentionally
set time stamp (in contrast to UNIX time stamp 0) which has no meaning
and is easy to recognize.

I noticed this issue today after reading the following blog post: https://fzakaria.com/2021/06/28/java-nix-reproducibility.html
I also verified that this is indeed an issue in DiffDetective and that it's solved by this PR.

Unfortunately, JAR files store time stamps of the files inside them.
These time stamps depend on the build time of these files hence breaking
bit for bit reproducibility. By setting all time stamps to a predefined
value and removing superfluous build artifacts this issue can be
avoided. Conventionally, UNIX time stamp 1 signifies an intentionally
set time stamp (in contrast to UNIX time stamp 0) which has no meaning
and is easy to recognize.
@pmbittner
Copy link
Member

Interesting! Thanks for the fix! 🥳

@pmbittner pmbittner merged commit d1bf2d7 into develop Mar 22, 2024
2 checks passed
@pmbittner pmbittner mentioned this pull request Apr 27, 2024
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