Skip to content

Commit be5f1f1

Browse files
authored
Update KSP to 2.3.5 (#434)
1 parent e9d1f26 commit be5f1f1

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Changelog
44
**Unreleased**
55
--------------
66

7+
- Update to KSP `2.3.5` and remove the memory leak patch as it's now fixed upstream.
8+
79
0.12.1
810
------
911

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
gjf = "1.33.0"
33
kotlin = "2.3.0"
44
kotlinpoet = "2.2.0"
5-
ksp = "2.3.4"
5+
ksp = "2.3.5"
66
ktfmt = "0.61"
77

88
[plugins]

ksp/src/main/kotlin/com/tschuchort/compiletesting/Ksp2.kt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
/* Adds support for KSP (https://goo.gle/ksp). */
22
package com.tschuchort.compiletesting
33

4-
import com.google.devtools.ksp.impl.KSPCoreEnvironment
54
import com.google.devtools.ksp.impl.KotlinSymbolProcessing
65
import com.google.devtools.ksp.processing.KSPJvmConfig
76
import com.google.devtools.ksp.processing.SymbolProcessorProvider
87
import java.io.File
98
import java.io.PrintStream
109
import java.util.EnumSet
11-
import ksp.com.intellij.openapi.application.ApplicationManager as ShadedKspApplicationManager
12-
import ksp.com.intellij.openapi.util.Disposer as ShadedKspDisposer
13-
import ksp.com.intellij.openapi.util.Disposer.dispose
1410
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
1511
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
1612

@@ -135,22 +131,8 @@ class Ksp2PrecursorTool : PrecursorTool, KspTool {
135131
}
136132
} finally {
137133
logger.reportAll()
138-
clearKspLeaks()
139134
}
140135
}
141-
142-
/**
143-
* KSP leaks its core environment because its CLI appears to be intended for single-shot use and
144-
* stores stuff in ThreadLocals.
145-
*
146-
* The Gradle plugin doesn't seem to run into this because it runs all the tasks in an isolated
147-
* classloader that dies between task runs.
148-
*/
149-
private fun clearKspLeaks() {
150-
KSPCoreEnvironment.instance_prop.remove()
151-
// Doesn't _seem_ necessary but just in case, since it does appear to spin this up
152-
ShadedKspApplicationManager.getApplication()?.let(ShadedKspDisposer::dispose)
153-
}
154136
}
155137

156138
private fun KotlinVersion.languageVersion(): String {

0 commit comments

Comments
 (0)