Open mattstermiller opened 1 month ago
@mattstermiller thanks for reporting this. A fix is on the way.
During testing the issue appears only with Java 8. As a sanity check are you using Java 8? Thanks.
No, I'm using Oracle's Java 17:
> java --version
java 17.0.9 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 17.0.9+11-LTS-201)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.9+11-LTS-201, mixed mode, sharing)
What version of gradle?
> ./gradlew --version
------------------------------------------------------------
Gradle 7.3.3
------------------------------------------------------------
Build time: 2021-12-22 12:37:54 UTC
Revision: 6f556c80f945dc54b50e0be633da6c62dbe8dc71
Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.9 (Oracle Corporation 17.0.9+11-LTS-201)
OS: Windows 11 10.0 amd64
I just updated my wrapper to the latest 8.10.2 and the issue persists.
Please try with release 2024.1.37. I will continue to try to reproduce on JDKs greater than 8.
A clean and build with these dependency updates gave the same error.
implementation("systems.manifold:manifold-ext-rt:2024.1.37")
annotationProcessor("systems.manifold:manifold-ext:2024.1.37")
Are you using the duplicate-class.zip example? Using that I can only repro w JDK 8
Screenshots for illustrating a successful JDK 17 build.
Yes, I am using the same example I posted. Just to be sure, I re-downloaded and opened it from there. Same error.
My gradle settings look mostly the same:
Are there any other local environment things I should check?
Thanks for looking into this, by the way.
Did you set your Project SDK and Language level?
if you are building from the command line, ensure you are performing a clean build. Also make sure there aren't any stray java daemon processes that gradle could be using in error. Otherwise, it should work. If it doesn't, try making a project from scratch by placing the build.gradle file in an empty directory and loading it in IJ as a project. Then add your source file and ensure gradle etc. is setup correctly.
apply plugin: 'java'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation("org.apache.commons:commons-lang3:3.17.0")
implementation("systems.manifold:manifold-ext-rt:2024.1.37")
annotationProcessor("systems.manifold:manifold-ext:2024.1.37")
}
tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xplugin:Manifold']
}
Here's my project settings:
I tried several other SDKs in my list which are based on java 11 or 17 (clean then build) and they all fail with the same duplicate class error. I've made sure there are no other gradle daemons or java processes running. As far as making a project from scratch, that's what I've already done for this minimal repro project I provided.
Describe the bug Using manifold-ext and the Pair type from org.apache.commons:commons-lang3 WITHOUT any import of java.util.Map causes a duplicate class compiler error:
Simply adding
import java.util.Map;
to any java file in the project makes the error go away. But this is certainly not obvious and turns up as an unused import and could be auto-removed by some IDEs.To Reproduce Steps to reproduce the behavior:
./gradlew assemble
Expected behavior Project should compile without error.
Desktop (please complete the following information):