RFR: 8276766: Enable jar and jmod to produce deterministic timestamped content [v9]

Andrew Leonard aleonard at openjdk.java.net
Tue Nov 30 12:15:15 UTC 2021


On Mon, 29 Nov 2021 16:22:30 GMT, Andrew Leonard <aleonard at openjdk.org> wrote:

>> Add a new --source-date <TIMESTAMP> (epoch seconds) option to jar and jmod to allow specification of time to use for created/updated jar/jmod entries. This then allows the ability to make the content deterministic.
>> 
>> Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>
> Andrew Leonard has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>    
>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>    
>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>

I see maybe 2 ways forward:
1) We either prove always setting an mtime(FileTime) has no impact in JVM startup, and is an acceptable behavior change
2) We implement the original fix in 2 stages:
a) jdk-18: setTimeLocal() change, which provides deterministic behavior over years 1980-2106 (which is in keeping with the theme of JDK-8073497 !)
b) jdk-19+: provide ZipEntry Zoned time setting support

-------------

PR: https://git.openjdk.java.net/jdk/pull/6481


More information about the compiler-dev mailing list