ADTRAN / gradle-scala-multiversion-plugin

Gradle plugin to build a project against multiple versions of Scala
Apache License 2.0
31 stars 14 forks source link

"Scala signature has wrong version" in CI build with subprojects #39

Open cric96 opened 3 years ago

cric96 commented 3 years ago

First, I tried to create a minimal working example to reproduce this error. The project is here and the build that fails is here. The full error is:

java.io.IOException: Scala signature B has wrong version
 expected: 5.0
 found: 5.2 in B.class
    at scala.reflect.internal.pickling.UnPickler$Scan.checkVersion(UnPickler.scala:124)

It seems that with two (or more) Scala subprojects where one of which depends on the other, Gradle runs them in parallel (as you can see here) using a different scala compiler version, causing the exception reported above.

One workaround I found for now is to set the Gradle max-workers to 1 (as you can see here)

nathanalderson commented 3 years ago

Interesting. Thanks for creating a minimal project. I'm not sure how to solve this, but I'll try to take a look some time.