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

Make it possible to run scalafix with the same scala binary version as the target #32

Closed
bjaglin opened this issue Dec 9, 2020 · 3 comments · Fixed by #38
Closed

Make it possible to run scalafix with the same scala binary version as the target #32

bjaglin opened this issue Dec 9, 2020 · 3 comments · Fixed by #38

Comments

@bjaglin
Copy link

bjaglin commented Dec 9, 2020

This is necessary for advanced rules using the presentation compiler such as ExplicitResultTypes to work.

See

@marcelocenerine
Copy link
Member

@bjaglin the Gradle plugin used to use the scalafix-interfaces jar and dynamically load Scalafix via a custom classloader. But for some reason I scratched that and started using the scalafix-cli jar instead: https://github.com/cosmicsilence/gradle-scalafix/pull/18/files#diff-49a96e7eea8a94af862798a45174e6ac43eb4f8b4bd40759b5da63ba31ec3ef7L19 . IIRC we were running into OOM issues in our integration tests due to scalafix + scala and all transitive dependencies being loaded multiple times via different classloader instances (on the same JVM). I will try to revisit that during my time off in the upcoming weeks.

Thanks for the pointers 👍 . It looks like Scalafix.fetchAndClassloadInstance simplifies things a lot.

@bjaglin
Copy link
Author

bjaglin commented Mar 9, 2021

Thanks for working on that! I see you kept classloading on the plugin side - no luck with caching Scalafix.fetchAndClassloadInstance?

@marcelocenerine
Copy link
Member

@bjaglin I did consider using fetchAndClassloadInstance (and it worked), but ultimately I decided to stick to Gradle's own dependency resolution mechanism for now (which is the approach I had before). I will revisit that once I get time to do more testing though.

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