From be71d8841ebc22c79bb6b4bc6f3ad93c147ba9c0 Mon Sep 17 00:00:00 2001 From: "Aleksei.Cherepanov" Date: Mon, 26 Sep 2022 16:38:46 +0200 Subject: [PATCH] Use case-sensitive logic in PathStringDescriptor for all platforms This is especially needed for portable caches. Now hash counting on mac/windows is the same as logic on linux, which allows to create caches on remote servers and use them together with incremental compilation locally. #KT-53932 Fixed --- .../jetbrains/kotlin/incremental/storage/externalizers.kt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/build-common/src/org/jetbrains/kotlin/incremental/storage/externalizers.kt b/build-common/src/org/jetbrains/kotlin/incremental/storage/externalizers.kt index 6d2ccfac59f..a5c2fd2d45f 100644 --- a/build-common/src/org/jetbrains/kotlin/incremental/storage/externalizers.kt +++ b/build-common/src/org/jetbrains/kotlin/incremental/storage/externalizers.kt @@ -253,20 +253,12 @@ object StringExternalizer : DataExternalizer { override fun read(input: DataInput): String = IOUtil.readString(input) } -// Should be consistent with org.jetbrains.jps.incremental.storage.PathStringDescriptor for correct work of portable caches object PathStringDescriptor : EnumeratorStringDescriptor() { - private const val PORTABLE_CACHES_PROPERTY = "org.jetbrains.jps.portable.caches" - private val PORTABLE_CACHES = java.lang.Boolean.getBoolean(PORTABLE_CACHES_PROPERTY) - override fun getHashCode(path: String): Int { - if (!PORTABLE_CACHES) return FileUtil.pathHashCode(path) - // On case insensitive OS hash calculated from value converted to lower case return if (StringUtil.isEmpty(path)) 0 else FileUtil.toCanonicalPath(path).hashCode() } override fun isEqual(val1: String, val2: String?): Boolean { - if (!PORTABLE_CACHES) return FileUtil.pathsEqual(val1, val2) - // On case insensitive OS hash calculated from path converted to lower case if (val1 == val2) return true if (val2 == null) return false