Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-25075 Build and test Spark against Scala 2.13
  3. SPARK-34258

Upgrade Scala to avoid Scala's bug about illegal cyclic reference

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.2.0
    • None
    • Build
    • None

    Description

      There is a regression in Scala 2.13. We should probably upgrade maintenance version of Scala 2.13 before Spark 3.2.0 release. Otherwise:

      scalaVersion := "2.13.2"
      
      libraryDependencies ++= Seq(
        "org.scala-lang" % "scala-reflect" % scalaVersion.value,
        "com.google.protobuf" % "protobuf-java" % "3.11.4"
      )
      
      package foo
      
      import scala.reflect.runtime.universe
      import com.google.protobuf.DescriptorProtos.FileDescriptorProto
      
      object Hello {
        def fromJava(t: FileDescriptorProto): Unit = {}
      }
      
      object Main {
        def main(args: Array[String]): Unit = {
          val mirror = universe.runtimeMirror(getClass.getClassLoader())
      
          println(
            mirror.reflectModule(
              mirror.staticModule("foo.Hello$"))
            .instance)
        }
      

      fails with the error below:

      [info] running foo.Main
      [error] (run-main-b) scala.reflect.internal.Symbols$CyclicReference: illegal cyclic reference involving type BuilderType
      

      See https://github.com/scala/bug/issues/12038 for more details.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Ngone51 wuyi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: