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

Should sbt.internal.inc.AnalyzingCompiler be Closeable? #1465

Open
Friendseeker opened this issue Oct 17, 2024 · 0 comments
Open

Should sbt.internal.inc.AnalyzingCompiler be Closeable? #1465

Friendseeker opened this issue Oct 17, 2024 · 0 comments

Comments

@Friendseeker
Copy link
Member

Friendseeker commented Oct 17, 2024

Currently sbt.internal.inc.AnalyzingCompiler holds a bunch of scala compiler related jars in its ClassLoaderCache.

While build tools can just call AnalyzingCompiler.classLoaderCache.map(_.close()) to release the jars, I am thinking if it would be better for AnalyzingCompiler to be Closeable, so build tools using Zinc can just call AnalyzingCompiler.close() and every resource that the Zinc compiler instance is holding is then closed.

Also making AnalyzingCompiler Closable makes it more obvious that Zinc holds certain resources, and once the build tool no longer need to use the compiler, the resources needs to be released.

@Friendseeker Friendseeker changed the title Should sbt.internal.inc.AnalyzingCompiler be closeable? Should sbt.internal.inc.AnalyzingCompiler be Closeable? Oct 17, 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

No branches or pull requests

1 participant