Why does sbt compile fail with StackOverflowError?

后端 未结 8 1255
孤独总比滥情好
孤独总比滥情好 2021-01-31 15:30

I am working on a Scala project that has been in existence for a few years but is new to me. My task is to upgrade it from Scala 2.9.3 to 2.11.7, along with its dependencies. I

8条回答
  •  走了就别回头了
    2021-01-31 15:55

    I discovered the SBT_OPT setting in the bin/sbt file of my sbt install was affecting the memory values set in my projects build.sbt

    updating the existing -Xss value in this file from 1M to 8M raised the memory size of the Scalac stack to a point I stopped getting StackOverflow exceptions in the sbt-invoked compiler. This seemed odd because the sbt documented approach to setting stack size in the compiler is to do this is with the -J-Xss setting.

    Sbt doesn't seem to actually enable you to set the compiler's stack memory. While a build.sbt accepts the following configuration as a valid setting, it doesn't seem to apply the value in the compiler:

    scalacOptions in ThisBuild ++= Seq(-J-Xss8M)

    I suspect that is a bug or non-implemented functionality

提交回复
热议问题