Skip to content

Use sbt makeScalaInstance #12771

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

Merged
merged 1 commit into from
Jun 9, 2021
Merged

Use sbt makeScalaInstance #12771

merged 1 commit into from
Jun 9, 2021

Conversation

adpi2
Copy link
Member

@adpi2 adpi2 commented Jun 9, 2021

and stop using sbt private extendedClassLoaderCache

): ScalaInstance = {
val cache = state.extendedClassLoaderCache

val fullLoader = cache(docJars.toList, base.loaderCompilerOnly)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version reused the classloader from base for compiler and library jars, whereas the new one will recreate it it seems, isn't that likely to be slower and require more memory?

Copy link
Member Author

@adpi2 adpi2 Jun 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class loaders are cached internally by sbt, based on the jars file. Here we use the compiler jars from the base Scala Instance, so the new compiler class loader should be the same instance.

Copy link
Member Author

@adpi2 adpi2 Jun 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there is something wrong with the list of compiler jars, so I will fix it and add an assert to ensure that the class loaders are the same.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smarter smarter enabled auto-merge June 9, 2021 13:49
@adpi2 adpi2 disabled auto-merge June 9, 2021 13:54
@adpi2 adpi2 enabled auto-merge June 9, 2021 14:10
@adpi2 adpi2 merged commit 07f949a into scala:master Jun 9, 2021
@adpi2 adpi2 deleted the sbt-1.5.3 branch March 7, 2025 12:49
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 this pull request may close these issues.

2 participants