Do not use File.canonicalPath in incremental caches

This fix improves performance of incremental compilation on Windows
machines.
When portable JPS caches are used, DirtyFilesHolder.getRemovedFiles
could return file names which are not allowed on current platform.
Previously it resulted in IOException on File.getCanonicalFile.
#KT-53735 Fixed
This commit is contained in:
Andrey Uskov
2022-10-18 00:47:42 +03:00
committed by teamcity
parent 9c1de4be9a
commit 3832c6a520
3 changed files with 6 additions and 6 deletions
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.incremental.*
import org.jetbrains.kotlin.incremental.classpathDiff.BreadthFirstSearch.findReachableNodes
import org.jetbrains.kotlin.incremental.classpathDiff.ClasspathSnapshotShrinker.shrinkClasspath
import org.jetbrains.kotlin.incremental.classpathDiff.ImpactedSymbolsComputer.computeImpactedSymbols
import org.jetbrains.kotlin.incremental.storage.FileToCanonicalPathConverter
import org.jetbrains.kotlin.incremental.storage.FileToAbsolutePathConverter
import org.jetbrains.kotlin.incremental.storage.ListExternalizer
import org.jetbrains.kotlin.incremental.storage.loadFromFile
import org.jetbrains.kotlin.name.ClassId
@@ -203,7 +203,7 @@ object ClasspathChangesComputer {
): ProgramSymbolSet {
val workingDir =
FileUtil.createTempDirectory(this::class.java.simpleName, "_WorkingDir_${UUID.randomUUID()}", /* deleteOnExit */ true)
val incrementalJvmCache = IncrementalJvmCache(workingDir, /* targetOutputDir */ null, FileToCanonicalPathConverter)
val incrementalJvmCache = IncrementalJvmCache(workingDir, /* targetOutputDir */ null, FileToAbsolutePathConverter)
// Step 1:
// - Add previous class snapshots to incrementalJvmCache.