RFR: 8371855: Time stamps are missing on zip bundles with gradle 9
John Neffenger
jgneff at openjdk.org
Mon Dec 1 16:01:49 UTC 2025
On Mon, 1 Dec 2025 10:27:10 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:
> Gradle 9 onwards, the [Archive tasks (Jar, Ear, War, Zip, AbstractArchiveTask) produce reproducible archives by default](https://docs.gradle.org/current/userguide/upgrading_major_version_9.html#reproducible_archives_by_default)
>
> Under this change, there are two factors that affect our zip files.
> 1. Files have fixed timestamps (timestamps depends on the archive type).
> 2. File order in the archive is now deterministic.
> Especially the timestamp is a concern, the files now have a fixed timestamp i.e. 1 Feb 1980 instead of the creation date.
>
> the [gradle upgrading guide](https://docs.gradle.org/current/userguide/upgrading_major_version_9.html#reproducible_archives_by_default) provides the solution on how to restore previous behavior. The fix picks 2 necessary flags.
>
> Verified that for all files extracted from generated zip files:
> 1. Timestamp is now not fixed, and reflects the CREATION date.
> 2. The file permissions are unchanged.
Why don't we instead start building JavaFX in a reproducible manner? I've been creating reproducible [builds of JavaFX][1] for years now (with the caveat of [this bug][2]). Those builds have over 2,000 active users without any reported problems. I set the following environment variable before calling `gradlew`:
# Sets the environment variable for reproducible builds
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
export SOURCE_DATE_EPOCH
Doing so now can only help Johan's efforts to replace the Gradle build with its JDK-based alternative.
[1]: https://snapcraft.io/openjfx
[2]: https://bugs.openjdk.org/browse/JDK-8307082
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1993#issuecomment-3597360213
More information about the openjfx-dev
mailing list