Use symbol-processing-aa-embeddable in Gradle#2006
Merged
Conversation
neetopia
approved these changes
Jul 18, 2024
| if (kspClassLoaderCache[key] == null) { | ||
| kspClassLoaderCache[key] = URLClassLoader( | ||
| kspClasspath.files.map { it.toURI().toURL() }.toTypedArray(), | ||
| this.javaClass.classLoader |
Contributor
There was a problem hiding this comment.
This means we are no longer isolating from Gradle's classpath is that correct?
Contributor
Author
There was a problem hiding this comment.
Yeah, it should be better to leave it isolated from Gradle's. The PR is updated.
isolatedClassloader only isolates KSP from Gradle classpath. Bundled classes in the KSP jar can still be seen by processors and pollute their classpath. Replacing symbol-processing-aa with symbol-processing-aa-embeddable solves both issues. Note that classloaders are still required for: 1. loading KSP2 when needed, so that KSP1 doesn't download the fat jar. 2. processors need to be re-loaded everytime, in case of improper uses of static variables and/or memory leak. 3. isolating processors from Gradle's classpath.
neetopia
approved these changes
Jul 19, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
isolatedClassloader only isolates KSP from Gradle classpath. Bundled classes in the KSP jar can still be seen by processors and pollute their classpath. Replacing symbol-processing-aa with
symbol-processing-aa-embeddable solves both issues.
Note that classloaders are still required for: