Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use custom JVM versions during Scala compilation #3982

Open
lihaoyi opened this issue Nov 18, 2024 · 1 comment · May be fixed by #3995
Open

Use custom JVM versions during Scala compilation #3982

lihaoyi opened this issue Nov 18, 2024 · 1 comment · May be fixed by #3995
Milestone

Comments

@lihaoyi
Copy link
Member

lihaoyi commented Nov 18, 2024

Follow up from #3480

Currently JavaModule#compile with a custom JVM relies on Zinc forking a JVM for each Java compilation, which is slow, and Zinc does not support forking JVMs for ScalaModule#compile and it would anyway be prohibitively slow (upstream discussion sbt/zinc#1498).

The correct solution for this is to move ZincWorkerImpl into a long-lived worker subprocess when def javaHome is overridden. This will allow us to keep the Java compilation process warm so it can benefit from the fast in-memory compiles, while also supporting Scala compilation on custom JVM versions

This will likely require an overhaul of the ZincWorkerApi.scala to dis-entangle things sufficiently that we can impose a subprocess boundary between the caller and callee. This would break binary compatibility and would need to wait for 0.13.0

@lihaoyi lihaoyi changed the title Make custom JVM versions used during Scala compilation Use custom JVM versions during Scala compilation Nov 18, 2024
@roman-mibex-2
Copy link

The mentioned relevant Zinc issue: sbt/zinc#1498

@lihaoyi lihaoyi added this to the 0.13.0 milestone Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants