mirror of https://github.com/sbt/sbt.git
Closing the ManagedClassLoader generated by test can cause nonlocal effects because the jdk shares some JarFile resources across multiple URLClassLoaders. As a result, if one classloader is trying to load a resource and the classloader is closed, it might cause the resource loading to fail (see https://github.com/sbt/sbt/issues/5262). This can be fixed by moving the scalatest framework jar (and its dependencies) into an additional classloader layer that sits between the scala library loader and the rest of the test dependencies. In addition to adding the new layer, I reworked the ReverseLookupClassLoader to use its dependent classloader to find resources that may below it in the classloading hierarchy rather than constructing an entirely new classloader for resources. After this change, I was able to run test in the repro project: https://github.com/rjmac/sbt-5262 1000 times with no failures. Note that the repro is sensitive to the jdk used. I could not reproduce with jdk11 but I could typically induce a failure within 20 or so runs with jdk8. I benchmarked this change with https://github.com/eatkins/scala-build-watch-performance and performance was roughly the same as 1.3.4 with turbo mode and about 200-250ms faster in non-turbo mode (which can be explained by the time to load the scalatest classes). |
||
|---|---|---|
| .github/ISSUE_TEMPLATE | ||
| core-macros/src/main/scala/sbt/internal/util/appmacro | ||
| internal | ||
| launch | ||
| licenses | ||
| main | ||
| main-actions/src | ||
| main-command/src | ||
| main-settings/src | ||
| notes | ||
| project | ||
| protocol/src/main | ||
| run | ||
| sbt/src | ||
| scripted-plugin/src/main/scala/sbt | ||
| scripted-sbt-old/src/main/scala/sbt/test | ||
| scripted-sbt-redux | ||
| src/main/conscript | ||
| tasks | ||
| tasks-standard | ||
| testing | ||
| vscode-sbt-scala | ||
| zinc-lm-integration/src | ||
| .appveyor.yml | ||
| .gitattributes | ||
| .gitignore | ||
| .java-version | ||
| .mailmap | ||
| .sbtopts | ||
| .scalafmt.conf | ||
| .travis.yml | ||
| CONTRIBUTING.md | ||
| DEVELOPING.md | ||
| LICENSE | ||
| NOTICE | ||
| PROFILING.md | ||
| README.md | ||
| SUPPORT.md | ||
| build.sbt | ||
| reset.sh | ||
| sbt-allsources.sh | ||
| server.md | ||
README.md
sbt
sbt is a build tool for Scala, Java, and more.
For general documentation, see http://www.scala-sbt.org/.
sbt 1.x
This is the 1.x series of sbt. The source code of sbt is split across several GitHub repositories, including this one.
- sbt/io hosts
sbt.iomodule. - sbt/util hosts a collection of internally used modules.
- sbt/librarymanagement hosts
sbt.librarymanagementmodule that wraps Ivy. - sbt/zinc hosts Zinc, an incremental compiler for Scala.
- sbt/sbt, this repository hosts modules that implements the build tool.
Other links
- Setup: Describes getting started with the latest binary release.
- FAQ: Explains how to get help and more.
- sbt/sbt-zero-seven: hosts sbt 0.7.7 and earlier versions
Issues and Pull Requests
Please read CONTRIBUTING carefully before opening a GitHub Issue.
The short version: try searching or asking on StackOverflow.
license
See LICENSE.