On Tue, 23 Nov 2021 20:29:15 GMT, Andrew Leonard <aleon...@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 <anleo...@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 <anleo...@redhat.com>
>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>    
>    Signed-off-by: Andrew Leonard <anleo...@redhat.com>
>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>    
>    Signed-off-by: Andrew Leonard <anleo...@redhat.com>
>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>    
>    Signed-off-by: Andrew Leonard <anleo...@redhat.com>
>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>    
>    Signed-off-by: Andrew Leonard <anleo...@redhat.com>

> I just tested this pull request by building [my JavaFX pull 
> request](https://github.com/openjdk/jfx/pull/446) on six Linux architectures, 
> and it works beautifully!
> 
> First I built this pull request branch of OpenJDK for Linux on the following 
> hardware platforms: amd64 (x86_64), arm64 (aarch64), armhf (armv7l), i386 
> (i636), ppc64el (ppc64le), and s390x (s390x).
> 
> Then I added three lines of Groovy code to the JavaFX `build.gradle` file 
> where it invokes the `jmod` tool:
> 
> ```groovy-gradle
>     if (sourceDateEpoch != null) {
>         args("--source-date", sourceDateEpoch)
>     }
> ```
> 
> Then I built JavaFX twice for each of the architectures, with each build on a 
> clean, isolated container created from scratch. The result is 6 architectures 
> × 4,360 files = 26,160 identical files between the two sets of builds. The 
> JMOD archives were the last missing piece for JavaFX, so thank you, Andrew, 
> for completing the puzzle.
> 
> By the way, my builds of OpenJDK did not include your `jarjmodorder` branch, 
> yet the order for the entries in the JMOD archives are the same. In fact, I 
> checked my old builds and the entry order has always been the same between 
> builds for the JMOD archives. Only the entry timestamps were different. Is 
> that expected? I mean, although the order is not deterministic, is it 
> expected that they would end up in the same order when the archives are built 
> in the same environment by the same build process?

@jgneff thank you for testing, that's great news
on the "ordering" issue, it depends on your OS architecture among probably 
other things... for example try this:
- Build 1: on a Ubuntu 20.04 running on an Intel processor
- Build 2: on a Ubuntu 20.04 running on an AMD processor
I suspect you will find the order will differ...

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

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

Reply via email to