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

Lance Andersen lancea at openjdk.java.net
Mon Dec 6 01:53:19 UTC 2021


On Fri, 3 Dec 2021 10:05:43 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 with a new target base due to a merge or a rebase. The pull request now contains 25 commits:
> 
>  - Merge jdk:master
>    
>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>  - Merge branch 'master' of https://github.com/openjdk/jdk into jarjmodtimestamps
>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>    
>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>  - Merge branch 'jarjmodtimestamps' of github.com:andrew-m-leonard/jdk into jarjmodtimestamps
>  - Update src/jdk.jlink/share/classes/jdk/tools/jmod/JmodOutputStream.java
>    
>    Co-authored-by: Magnus Ihse Bursie <mag at icus.se>
>  - Merge branch 'master' of https://github.com/openjdk/jdk into jarjmodtimestamps
>  - 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>
>  - 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>
>  - ... and 15 more: https://git.openjdk.java.net/jdk/compare/45da3aea...06863697

Overall the latest update looks good

a few minor comments below 

the CSR needs some updates and I will look to provide comments tomorrow

src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties line 86:

> 84:         unexpected versioned entry {0} for release {1}
> 85: error.date.notvalid=\
> 86:         date {0} is not a valid ISO 8601 date and time

Please rephrase to use wording similar to what is in the Javadoc date-time with offset and zone

src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties line 88:

> 86:         date {0} is not a valid ISO 8601 date and time
> 87: error.date.out.of.range=\
> 88:         date {0} is not within the valid range

Please  include the range in the message

src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties line 298:

> 296: \  -0, --no-compress          Store only; use no ZIP compression
> 297: main.help.opt.create.update.index.date=\
> 298: \      --date=TIMESTAMP       The timestamp in ISO 8601 format to use\n\

Same comment as above perhaps show the syntax

src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties line 111:

> 109: err.no.moduleToHash=No hashes recorded: no module matching {0} found to record hashes
> 110: err.invalid.date=--date {0} is not a valid ISO 8601 date and time: {1} 
> 111: err.date.out.of.range=--date {0} is out of the valid range

Same comments as above

test/jdk/tools/jar/JarEntryTime.java line 191:

> 189:                                 "2038-11-26T06:06:06+00:00",
> 190:                                 "2098-02-18T00:00:00-08:00",
> 191:                                 "2099-12-31T23:59:59+00:00"};

I believe the parsing format you are using supports formats such as '2011-12-03T10:15:30', '2011-12-03T10:15:30+01:00' and'2011-12-03T10:15:30+01:00[Europe/Paris]'.

please add a few extra values to the above

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

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


More information about the core-libs-dev mailing list