Skip to content

Commit 320da62

Browse files
BarbatosBarbatos
authored andcommitted
fix(plugins): revert zksnark/commons-io alignment, document why
CI on rockylinux (x86_64 + JDK 8) failed under 0aebaff: org.tron.plugins.rocksdb.DbLiteRocksDbTest > testToolsWithRocksDB FAILED org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'zksnarkInitService' ... NoClassDefFoundError: org/apache/commons/io/FileUtils After commit 69d7f21 mirrored the :platform excludes onto :crypto (reviewer's option A in #6738), x86 testRuntimeClasspath lost commons-io:commons-io and io.github.tronprotocol:zksnark-java-sdk entirely: both arrived only via :crypto -> :common -> :platform, which is now also excluding them. ARM64 was unaffected because the ARM64 branch declares :platform without exclusions. Diagnosis: the DbLiteTest Spring boot path loads org.tron.core.zen.ZksnarkInitService, which references both org.apache.commons.io.FileUtils and org.tron.common.zksnark.LibrustzcashWrapper at runtime. Reproduced on x86_64 docker: - removing only commons-io exclude -> FAILED at LibrustzcashWrapper - removing both exclusions -> testToolsWithRocksDB PASSED The :platform-side excludes for these two artifacts are therefore deduplication only, not a "kept out of plugins" intent. The leveldbjni-all exclude is the only one that must be mirrored, because that one is the actual classpath conflict. This commit drops the zksnark-java-sdk and commons-io excludes from :crypto and adds a comment recording why they are intentionally asymmetric with :platform. Verified on x86_64 + JDK 8 (eclipse-temurin:8-jdk): - :plugins:test passes (was 4 failed under 0aebaff) - runtimeClasspath still does NOT contain leveldbjni-all 1.8 - runtimeClasspath now contains commons-io and zksnark-java-sdk - Toolkit.jar smoke (db archive -d <empty>) still exits 0
1 parent 0aebaff commit 320da62

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

plugins/build.gradle

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,20 @@ dependencies {
3939
exclude group: 'io.prometheus'
4040
exclude group: 'org.aspectj'
4141
exclude group: 'org.apache.httpcomponents'
42-
// :crypto -> :common -> :platform transitively pulls in artifacts that
43-
// the direct :platform dependency below already excludes on x86. Mirror
44-
// those excludes here so both paths to :platform agree, otherwise the
45-
// transitive copies leak into the fat jar. In particular leveldbjni-all
46-
// 1.8 conflicts with io.github.tronprotocol leveldbjni-all 1.18.2: both
47-
// jars carry org/iq80/leveldb/Options.class; the duplicate-entry write
48-
// order in the fat jar can leave the 1.8 copy, which lacks
42+
// :crypto -> :common -> :platform transitively pulls leveldbjni-all
43+
// 1.8, which conflicts with the io.github.tronprotocol fork
44+
// leveldbjni-all 1.18.2 declared below on x86. Both jars carry
45+
// org/iq80/leveldb/Options.class; the duplicate-entry write order in
46+
// the fat jar can leave the 1.8 copy, which lacks
4947
// Options.maxBatchSize(int) and breaks `db archive` at runtime.
48+
//
49+
// The direct :platform dependency below also excludes
50+
// zksnark-java-sdk and commons-io, but those are *not* mirrored here:
51+
// the plugins test runtime (DbLiteTest -> Spring -> ZksnarkInitService)
52+
// actually loads classes from both, so :crypto must keep transitively
53+
// providing them. The :platform-side excludes are deduplication, not
54+
// a "kept out of plugins" intent.
5055
exclude group: 'org.fusesource.leveldbjni', module: 'leveldbjni-all'
51-
exclude group: 'io.github.tronprotocol', module: 'zksnark-java-sdk'
52-
exclude group: 'commons-io', module: 'commons-io'
5356
}
5457
implementation group: 'info.picocli', name: 'picocli', version: '4.6.3'
5558
implementation group: 'com.typesafe', name: 'config', version: '1.3.2'

0 commit comments

Comments
 (0)