RFR: 8276766: Enable jar and jmod to produce deterministic timestamped content [v4]
Mark Reinhold
mr at openjdk.java.net
Wed Nov 24 19:44:16 UTC 2021
On Tue, 23 Nov 2021 20:29:15 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 five commits:
>
> - 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>
> - 8276766: Enable jar and jmod to produce deterministic timestamped content
>
> Signed-off-by: Andrew Leonard <anleonar at redhat.com>
A user who’s not familiar with the lingo of [reproducible builds](https://reproducible-builds.org/docs/source-date-epoch/) will be mystified by an option named `--source-date`. A user who just wants to set the timestamp of new entries won’t be looking for an option whose name includes “source.”
Please consider providing a more general option, say `--date`, which takes an [ISO 8601 date/time string](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/format/DateTimeFormatter.html#ISO_DATE_TIME). That would solve the general problem while also satisfying the requirement for reproducible builds. In the build it’s easy enough to convert the seconds-since epoch value of `SOURCE_DATE_EPOCH` to an ISO 8601 string (`date -d @$SOURCE_DATE_EPOCH --iso-8601=seconds`).
-------------
PR: https://git.openjdk.java.net/jdk/pull/6481
More information about the compiler-dev
mailing list