Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow reproducible builds of all JDBC JAR files #566

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

jgneff
Copy link
Contributor

@jgneff jgneff commented Nov 13, 2022

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
Copy link
Contributor Author

jgneff commented Nov 13, 2022

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
Copy link
Contributor Author

jgneff commented Nov 14, 2022

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
2 participants