BTW @ilya.gorbunov is not quite right. Running compiler in-process is a viable option. It will be launched in an isolated classloader, so it will not clash with kotlin runtime bundled in Gradle (for GSK). There is a few caveats though:1.
do not support IC at the moment (which is not a problem for CI).
2. in theory we could try to cache
isolated classloader for a build, so the compiler classes would be optimized by JIT between compiler invokations. However previously caching classloader lead to memory leak, so for now we creating a new classloader for each invocation of the compiler (I'm going to look into this later).
3. Running compiler in-process can lead to a JVM crash https://youtrack.jetbrains.com/issue/KT-17031 (there is a workaround in the issue).
// cc @jw