Skip to content

Commit ee3b868

Browse files
BarbatosBarbatos
authored andcommitted
refactor(plugins): drop redundant zksnark/commons-io excludes from :platform
Per follow-up review on PR #6738 (halibobo1205): with :crypto now participating in plugins runtimeClasspath, the zksnark-java-sdk and commons-io excludes on the :platform-direct dependency are no longer "keep-out" semantics — both artifacts arrive via :crypto -> :common -> :platform anyway, and Gradle deduplicates to a single resolved copy. Removing them from :platform makes the two project-dep blocks mirror-symmetric: each excludes only leveldbjni-all on x86, which is the actual class-collision fix. Also tightens the :crypto comment now that the dropped excludes no longer need an asymmetry note. The unrelated test-needs-zksnark/commons context is captured on the :platform side instead. Verified on both arches: - ARM64: runtimeClasspath has leveldbjni-all 1.8 (via :platform direct), commons-io, and zksnark-java-sdk; :plugins:test passes - x86_64 + JDK 8: runtimeClasspath has io.github.tronprotocol leveldbjni-all 1.18.2 only, plus commons-io and zksnark-java-sdk; :plugins:test passes; `db archive -d <empty>` smoke exits 0
1 parent 26f463b commit ee3b868

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

plugins/build.gradle

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,13 @@ dependencies {
3939
exclude group: 'io.prometheus'
4040
exclude group: 'org.aspectj'
4141
exclude group: 'org.apache.httpcomponents'
42-
// x86 declares io.github.tronprotocol:leveldbjni-all:1.18.2 below.
42+
// x86 declares io.github.tronprotocol:leveldbjni-all:1.18.2 below;
4343
// :crypto -> :common -> :platform also transitively pulls
44-
// org.fusesource.leveldbjni:leveldbjni-all:1.8; both jars carry
45-
// org/iq80/leveldb/Options.class and the duplicate-entry write order
46-
// in the fat jar can leave the 1.8 copy, which lacks
47-
// Options.maxBatchSize(int) and breaks `db archive` at runtime.
48-
// Drop the 1.8 transitive on x86 only; ARM64 has a single copy via
49-
// its direct :platform declaration and no conflict.
50-
//
51-
// zksnark-java-sdk and commons-io are deliberately NOT mirrored from
52-
// the :platform-direct excludes below: the plugins test runtime
53-
// (DbLiteTest -> Spring -> ZksnarkInitService) loads classes from
54-
// both at runtime, so :crypto must keep transitively providing them.
44+
// org.fusesource.leveldbjni:leveldbjni-all:1.8. Both jars carry
45+
// org/iq80/leveldb/Options.class and the fat jar's last-write-wins
46+
// merge can leave the 1.8 copy, which lacks Options.maxBatchSize(int)
47+
// and breaks `db archive` at runtime. Drop the 1.8 transitive on x86
48+
// only; ARM64 has a single copy via :platform direct and no conflict.
5549
if (!rootProject.archInfo.isArm64) {
5650
exclude group: 'org.fusesource.leveldbjni', module: 'leveldbjni-all'
5751
}
@@ -65,9 +59,12 @@ dependencies {
6559
implementation project(":platform")
6660
} else {
6761
implementation project(":platform"), {
62+
// Only leveldbjni-all is excluded; the io.github.tronprotocol
63+
// 1.18.2 fork below is the version we want on x86. zksnark-java-sdk
64+
// and commons-io are intentionally kept (the plugins test runtime
65+
// needs both via :crypto -> :common -> :platform and the duplicate
66+
// resolution dedups to one copy).
6867
exclude(group: 'org.fusesource.leveldbjni', module: 'leveldbjni-all')
69-
exclude(group: 'io.github.tronprotocol', module: 'zksnark-java-sdk')
70-
exclude(group: 'commons-io', module: 'commons-io')
7168
}
7269
implementation 'io.github.tronprotocol:leveldbjni-all:1.18.2'
7370
implementation 'io.github.tronprotocol:leveldb:1.18.2'

0 commit comments

Comments
 (0)