Commit Graph

12 Commits

Author SHA1 Message Date
Adrien Piquerez 5f4197cf2e Use scala-doc-tool config for scala3doc 2021-01-04 10:01:34 +01:00
Adrien Piquerez 08b83d6b31 Fetch Scala 3 compiler bridge binary module
Contrary to Scala 2, Scala 3 compiler bridges are tied to the compiler
version. There is one compiler bridge foreach compiler version.
Scala compiler bridges are pure java so they are binary compatible with
all Scala version. Consequently, we can fetch the binary module directly
without using the ZincCompilerBridgeProvider.
2020-12-23 21:20:59 +01:00
Eugene Yokota 3c955abea6 Fix compiler bridge concurrency issue
Fixes https://github.com/sbt/sbt/issues/5785
2020-12-21 00:13:14 -05:00
Eugene Yokota 3ce4d22b84 integrate with VirtualFile changes
Ref https://github.com/sbt/zinc/pull/712
2020-04-24 17:44:14 -04:00
Ethan Atkins cf745255e8 Apply javafmt in sbt project 2020-01-14 14:38:08 -08:00
Eugene Yokota f5090cf70f Fix Zinc component compiler to respect -Dsbt.ivy.home
This is currently blocking the new nightly process.
2019-12-29 16:55:38 -05:00
Ethan Atkins 03bf539ce9 Add new ClassLoaderCache implementation
This commit adds a new ClassLoaderCache that builds on the
ClassLoaderCache that is present in zinc (and can be used to build an
instance of the zinc ClassLoaderCache to preserve compatibility). It
differs from the zinc classloader cache that it does not use direct
SoftReferences to classloaders. Instead, we create a wrapper loader
that can't load any classes and just delegates to its parent. This
allows us to add a thread that reaps the soft reference to the wrapper
loader. Crucially, we add a custom SoftReference class that has a strong
reference to the underlying classloader. This allows us to call close on
the strong reference.

The one issue with this approach is that we can't
rescue the jvm from crashing with an OOM: metaspace because the jvm
doesn't give us a chance to close and dereference the underlying
classloaders before it crashes. It WILL collect classloaders under
normal memory pressure, just not metaspace pressure. To fix this, I
check if the MaxMetaspaceSize is set via an MxBean and, if it is, we
fill the cache with regular soft references. We are going to change the
bash script to not set -XX:MaxMetaspaceSize by default so most builds
should probably end up correctly closing the classloaders after this
change. But we should break existing builds that set MaxMetaspaceSize
but don't crash.

As part of this commit, I audited all of the places where we were
instantiating ClassLoaderCache instances and instead pass in the
state's ClassLoaderCache instance. This reduces the total number of
classloaders created.
2019-05-28 09:53:35 -07:00
Dale Wijnand d51a5ef16e
Miscellaneous zinc-lm-integration cleanups 2019-04-29 14:40:55 +01:00
Dale Wijnand 736a1fa624
Switch back to unsuffixed 2.13 compiler bridge sources
Using the newer zinc version there now is a compiler bridge source jar
with suffix _2.13.
2019-04-28 23:41:48 +01:00
Eugene Yokota 04197db2ec formatting 2019-04-28 17:27:24 -04:00
Dale Wijnand 9a56c0d005
Cleanup zinc-lm-integration 2019-04-25 12:01:33 +01:00
Dale Wijnand e978357e47
In-source zinc's LM integration code 2019-04-25 11:57:37 +01:00