Don't leak the sbt boot scala library into tests

It was reported in https://github.com/sbt/sbt/issues/4608 that there was
a regression that tests run against scala 2.11 would fail. This was
because the interface loader incorrectly contained the scala library. To
fix this, I needed to find the xsbt.boot.BootFilteredLoader in the
classloading hierarchy and put the sbt testing interface library in
between that loader and the scala library loader.
This commit is contained in:
Ethan Atkins
2019-04-07 15:08:52 -07:00
parent c9aec02d05
commit fc715cab44
5 changed files with 29 additions and 2 deletions
@@ -255,7 +255,9 @@ final class ScriptedTests(
case "source-dependencies/linearization" => LauncherBased // sbt/Package$
case "source-dependencies/named" => LauncherBased // sbt/Package$
case "source-dependencies/specialized" => LauncherBased // sbt/Package$
case _ => RunFromSourceBased
case "tests/test-cross" =>
LauncherBased // the sbt metabuild classpath leaks into the test interface classloader in older versions of sbt
case _ => RunFromSourceBased
}
// sbt/Package$ means:
// java.lang.NoClassDefFoundError: sbt/Package$ (wrong name: sbt/package$)