Unreproducible Tomacat Issue

John Neffenger john at status6.com
Sat Nov 12 21:19:08 UTC 2022


On 11/11/22 4:52 PM, Rahul Rajesh Bajaj wrote:
> Any input from the java folks would be appreciated.

I have two follow-up messages. First ...

Just for reference, I tested a default build using the 'main' branch of 
the Apache Tomcat repository:

$ SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
$ export SOURCE_DATE_EPOCH
$ ant

and using the Ant and OpenJDK 17 packages in Ubuntu 22.04 LTS:

$ ant -version
Apache Ant(TM) version 1.10.12 compiled on January 17 1970

$ java --version
openjdk 17.0.5 2022-10-18
OpenJDK Runtime Environment (build 17.0.5+8-Ubuntu-2ubuntu122.04)
OpenJDK 64-Bit Server VM (build 17.0.5+8-Ubuntu-2ubuntu122.04, mixed 
mode, sharing)

Two successive builds were reproducible except for some timestamps in 
the 'tomcat-jdbc-src.jar' archive:

https://try.diffoscope.org/zfvpxxdctgya.html

resulting from the timestamps of these three files:

$ ll */jdbc-pool/resources/MANIFEST.MF
-rw-r--r-- 1 ubuntu ubuntu 1068 Nov 12 10:47 
modules/jdbc-pool/resources/MANIFEST.MF
-rw-r--r-- 1 ubuntu ubuntu 1088 Nov 12 10:57 
output1/jdbc-pool/resources/MANIFEST.MF
-rw-r--r-- 1 ubuntu ubuntu 1088 Nov 12 11:15 
output2/jdbc-pool/resources/MANIFEST.MF

$ ll */jdbc-pool/LICENSE
-rw-r--r-- 1 ubuntu ubuntu 11356 Nov 12 10:47 modules/jdbc-pool/LICENSE
-rw-r--r-- 1 ubuntu ubuntu 11356 Nov 12 10:57 output1/jdbc-pool/LICENSE
-rw-r--r-- 1 ubuntu ubuntu 11356 Nov 12 11:15 output2/jdbc-pool/LICENSE

$ ll */jdbc-pool/NOTICE
-rw-r--r-- 1 ubuntu ubuntu 178 Nov 12 10:47 modules/jdbc-pool/NOTICE
-rw-r--r-- 1 ubuntu ubuntu 178 Nov 12 10:57 output1/jdbc-pool/NOTICE
-rw-r--r-- 1 ubuntu ubuntu 178 Nov 12 11:15 output2/jdbc-pool/NOTICE

Those differences can be fixed with the following patch:

diff --git a/modules/jdbc-pool/build.xml b/modules/jdbc-pool/build.xml
index 8b387af62a..50f7d63182 100644
--- a/modules/jdbc-pool/build.xml
+++ b/modules/jdbc-pool/build.xml
@@ -185,7 +185,9 @@

    <target name="build-src">
      <!-- connection pool source file-->
-    <jar jarfile="${tomcat-jdbc-src.jar}" update="true">
+    <jar jarfile="${tomcat-jdbc-src.jar}"
+         update="true"
+         modificationtime="${tstamp.file}">
        <fileset dir="${basedir}/src/main/java">
          <include name="org/apache/tomcat/jdbc/**" />
        </fileset>

I'll look into submitting this patch as a pull request to Apache Tomcat.

John



More information about the rb-general mailing list