Skip to content

Unmanaged scalaInstance ends up on test framework's classpath when it shouldn't #2640

@szeiger

Description

@szeiger

When creating the test classloader in https://github.com/sbt/sbt/blob/54d54b9f4f03e2e3339373ed582f2b19359bea31/testing/src/main/scala/sbt/TestFramework.scala#L196-198, sbt puts the project's scalaInstance on the classpath if it is unmanaged.

For some reason the scalaInstance in our build (see scala/scala@02d75b3) is seen as unmanaged by sbt despite being resolved through Ivy. It's not clear to me whether this is correct but the real issue is that sbt does not check the autoScalaLibrary setting, thus putting the scalaInstance's JARs on the classpath even if autoScalaLibrary is set to false.

The workaround in scala/scala@02d75b3 should make sbt see the scalaInstance as managed, thus keeping it off the classpath but I haven't verified it yet. It uses a deprecated ScalaInstance constructor, so it's not a viable long-term solution. We're currently using sbt 0.13.11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions