-
Notifications
You must be signed in to change notification settings - Fork 212
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
Reproducible ZIP timestamps are dependent on machine timezone #926
Comments
Humm, intresting I thought I copied the code used by gradle 🤔 See: https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/java/org/gradle/api/internal/file/archive/ZipCopyAction.java#L41-L56 |
The timestamp that piece of code generates is identical, however Gradle uses the |
Ah, I see thats a little bit silly how they differ. I will have to take a deeper dive into Java's zip library to see if there is a way around this, id prefer not to use a 3rd party lib if we can help it. |
Good luck! I tried around with that a bit because I wanted to submit a PR to fix this originally but didn't end up anywhere sadly, and was unsure whether introducing another dependency would be wanted. |
Another option might be to look into seeing if its possible to use the gradle API to do this. Worse case we can add another dependency, it just seems a bit silly to need it for this. |
Currently when building with reproducibility enabled the timestamps inside the archive are dependent on the timezone of the machine building the mod. This diverges from the way Gradle itself handles this, as it always outputs a consistent timestamp of
1980-02-01 00:00
, regardless of build environment (at least from my testing).A few examples obtained using
unzip -v modid-1.0.0.jar
on the example mod built in different environments:Built via GHA, where I assume the machine time zone is UTC:
And from building the exact same commit on my local machine (currently CEST?):
I assume this is a difference in how timestamps are handled by Java's built in ZIP-related library and the apache compress library which is used by Gradle instead, since the constant timestamp used is exactly the same.
The text was updated successfully, but these errors were encountered: