Open scabug opened 7 years ago
Imported From: https://issues.scala-lang.org/browse/SI-10058?orig=1 Reporter: @som-snytt Affected Versions: 2.12.0 See #8521
This issue could be related : https://stackoverflow.com/questions/44217163/dynamic-compilation-with-scala-2-12-from-sbt-test (same stack trace, same goal to compile dynamically from sbt)
Root of the problem is that sbt for reason unknown runs tests with java system property java.class.path
set to ...bin/sbt-launch.jar
I managed to make scala compiler work by using -javacp and passing different classpath collected from sbt:
sbtClasspath := {
val cp = (fullClasspath in Test).value.map(x => x.data.getAbsolutePath).mkString(":")
System.setProperty("sbt-classpath", cp)
}
This approach works up to Scala 2.12.4
. 2.12.5
and up still fail with abovementioned exception.
This version of the test at #8521 fails to find ScriptEngine under sbt.
Created directly, the compiler fails to initialize.