Skip to content

Allow reproducible builds of all JDBC JAR files#566

Merged
markt-asf merged 1 commit into
apache:mainfrom
jgneff:reproducible-jdbc-jars
Nov 21, 2022
Merged

Allow reproducible builds of all JDBC JAR files#566
markt-asf merged 1 commit into
apache:mainfrom
jgneff:reproducible-jdbc-jars

Conversation

@jgneff

@jgneff jgneff commented Nov 13, 2022

Copy link
Copy Markdown
Contributor

Fixes Bug 66346. Only the first change is required to fix the timestamps in tomcat-jdbc-src.jar, but this seemed a good time to fix the timestamps in the other two JAR files as well (tomcat-jdbc-test.jar and tomcat-jdbc-test-src.jar).

Can someone let me know how I might test the building of those two test JAR files? I couldn't figure out which Ant target to use for building and comparing them. I did run the unit test cases, which were successful:

$ ant test
...
   [concat] Testsuites with failed tests:

test:

BUILD SUCCESSFUL
Total time: 110 minutes 45 seconds

@jgneff

jgneff commented Nov 13, 2022

Copy link
Copy Markdown
Contributor Author

I found how to test the Tomcat JDBC Connection Pool test JAR files (tomcat-jdbc-test.jar and tomcat-jdbc-test-src.jar). I first had to copy the build.properties.default file to build.properties with the following changes:

94c94
< tomcat.project.loc=https://svn.apache.org/repos/asf/tomcat/trunk/webapps/docs/project.xml
---
> tomcat.project.loc=https://github.com/apache/tomcat/tree/main/webapps/docs/project.xml
97c97
< tomcat.xsl.loc=https://svn.apache.org/repos/asf/tomcat/trunk/webapps/docs/tomcat-docs.xsl
---
> tomcat.xsl.loc=https://github.com/apache/tomcat/tree/main/webapps/docs/tomcat-docs.xsl

With those changes, I could run:

$ cd modules/jdbc-pool
$ ant build-test
$ mv output output1
$ ant build-test
$ mv output output2

Before this pull request, two consecutive builds show the following differences:

$ diff -qr output1 output2 
Files output1/tomcat-jdbc-src.jar and output2/tomcat-jdbc-src.jar differ
Files output1/tomcat-jdbc-test-src.jar and output2/tomcat-jdbc-test-src.jar differ
Files output1/tomcat-jdbc-test.jar and output2/tomcat-jdbc-test.jar differ

After this pull request, the contents of the two output directories are identical.

@jgneff

jgneff commented Nov 14, 2022

Copy link
Copy Markdown
Contributor Author

After this fix, the only remaining difference that I have found between any two builds of Tomcat using the default Ant target is the build path that gets included in two XML files:

$ diff -qr lxd/output1 kvm/output1
Files lxd/output1/jdbc-pool/doc/changelog.xml and kvm/output1/jdbc-pool/doc/changelog.xml differ
Files lxd/output1/jdbc-pool/doc/jdbc-pool.xml and kvm/output1/jdbc-pool/doc/jdbc-pool.xml differ
diff -r lxd/output1/jdbc-pool/doc/changelog.xml kvm/output1/jdbc-pool/doc/changelog.xml
19c19
<   <!ENTITY project SYSTEM "/home/ubuntu/src/tomcat/modules/jdbc-pool/includes/project.xml">
---
>   <!ENTITY project SYSTEM "/home/john/src/tomcat/modules/jdbc-pool/includes/project.xml">
diff -r lxd/output1/jdbc-pool/doc/jdbc-pool.xml kvm/output1/jdbc-pool/doc/jdbc-pool.xml
19c19
<   <!ENTITY project SYSTEM "/home/ubuntu/src/tomcat/modules/jdbc-pool/includes/project.xml">
---
>   <!ENTITY project SYSTEM "/home/john/src/tomcat/modules/jdbc-pool/includes/project.xml">

@markt-asf markt-asf merged commit 8ae3c81 into apache:main Nov 21, 2022
@jgneff jgneff deleted the reproducible-jdbc-jars branch November 21, 2022 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants