Open WojciechMazur opened 2 months ago
I've encountered this with working with https://github.com/carlosedp/scala3-quarkus-quickstart
Issue happens only for gradle, maven build works fine. after debugging this somewhat I've noticed that:
default Zinc version is outdated, but upgrading it it doesn't help
The params between gradle plugin and maven plugin when calling Zinc differ
Gradle:
2024-09-05T15:19:22.522+0200 [DEBUG] [org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory] [zinc] The Scala compiler is invoked with:
-deprecation
-unchecked
-feature
-Wunused:all
-Xtarget:8
-bootclasspath
/home/lmlynik/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.13.14/f8b4afe89abe48ca670f620c7da89b71f93e6546/scala-library-2.13.14.jar
-classpath
/home/lmlynik/IdeaProjects/scala3-quarkus-quickstart/build/classes/....
Maven:
[DEBUG] [zinc] The Scala compiler is invoked with:
-Wunused:all
-feature
-deprecation
-Ysemanticdb
-java-output-version
21
-bootclasspath
/home/lmlynik/.m2/repository/org/scala-lang/scala3-library_3/3.5.0/scala3-library_3-3.5.0.jar:/home/lmlynik/.m2/repository/org/scala-lang/scala-library/2.13.14/scala-library-2.13.14.jar
-classpath
/home/lmlynik/.m2/repository...
Notice that the maven plugin adds the scala3 library into the bootclasspath, where gradle doesn't
The issue is in the backlog of the relevant team and is prioritized by them.
Relates to:
Note that our capacity is limited for Scala topics and we welcome help from the community to resolve those issues. If you can confirm that the proposed fix for #27226 also fixes this issue, it would help. If not, figuring out the problem and explaining it here would also help.
Current Behavior
Compilation of projects fails, but only in Gradle. It works when using scala-cli or when invoking scalac directly. The issue seems to be related to JDK 9+ modules.
Crash report below
Since 3.5.0 the
NoClassDefFoundError
is catched in the compiler to finish to handle possible issues when pipelining is enabled. It would result in following error:Expected Behavior
Gradle should be able to compile the program correctly.
Context (optional)
The issue originated when testing Scala 3 with Quarkus and Mangum library, based on https://github.com/carlosedp/scala3-quarkus-quickstart It might affect new comers to the Gradle build tool.
Steps to Reproduce
Minimal reproducer project
Gradle version
8.10
Build scan URL (optional)
https://gradle.com/s/lv3v3ineu63ve
Your Environment (optional)
MacOS 14 Arm64, JDK 17, Scala 3.3.3 / 3.5.0