Reproducible Arch Linux in 2024/Q1 (irregular status update)

John Neffenger john at status6.com
Thu Mar 14 16:02:51 UTC 2024


Please note the correction at the end: JDK 17 and 19 (and not JDK 18) 
have the new '--date' option.

On 3/14/24 1:38 AM, Jelle van der Waa wrote:
>> MAVEN
>> ==========
> That is new to me!

The Maven indirect support for SOURCE_DATE_EPOCH is really nice, but 
they do have some version requirements, too. See:

Q: Which additional plugins need to be updated for Reproducible Builds?
https://maven.apache.org/guides/mini/guide-reproducible-builds.html#faq

>> GRADLE
> Some of our package maintainers in Arch have submitted patches for 
> OpenSearch to fix this. For plantuml I would have to add a new 
> tasks.withType() for every build.gradle.kts file in the repository I 
> assume?

That might work all by itself. Note that the Gradle timestamp with those 
settings is 1980-02-01 rather than the SOURCE_DATE_EPOCH instant.

For JMOD archives, the JavaFX project had to invoke the 'jmod' command 
directly with the new '--date' option with something like the following 
(written in Groovy):

   import java.time.Instant
   import java.time.temporal.ChronoUnit

   def buildInstant = Instant.now().truncatedTo(ChronoUnit.SECONDS)
   def sourceDateEpoch = System.getenv("SOURCE_DATE_EPOCH")
   if (sourceDateEpoch != null) {
       def epochSeconds = Long.parseLong(sourceDateEpoch)
       buildInstant = Instant.ofEpochSecond(epochSeconds)
   }
   // Creates the timestamp in UTC using the ISO 8601 extended format.
   def extendedTimestamp = buildInstant.toString()

   // ... later, when creating the JMOD task ...
   exec {
       commandLine(JMOD)
       args("create")
       // ... more arguments ...
       if (sourceDateEpoch != null) {
           args("--date", extendedTimestamp)
       }
       args(jmodFile)
   }

> Went digging some more:
> libbluray - uses ant

Apache Ant actually has direct support for the SOURCE_DATE_EPOCH 
environment variable! Ant is old, though, and not up-to-date with all 
the new Java features, so although it helps, I find that it doesn't 
solve all the problems.

> libjpeg-turbo - uses a CMAKE helper, so I assume that needs to be patched?
> https://cmake.org/cmake/help/latest/module/UseJava.html#command:add_jar

As with Gradle and Maven, it seems this higher-level tool is getting in 
the way of directly adding options to the 'jar' and 'jmod' commands.

> After a while I realized you said openjdk 18 which isn't packaged in the 
> Arch repositories yet :) So I'll continue this quest later :)

Correction! That should be JDK 19. I misread the original bug report. 
The new '--date' option went into JDK 19 and was back-ported to JDK 17. 
It did not go into JDK 18. Sorry about that.

Enable jar and jmod to produce deterministic timestamped content
https://bugs.openjdk.org/browse/JDK-8276766

John


More information about the rb-general mailing list