From b1aa582719c003b218652ee599c461aba0a3c97f Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Thu, 3 Aug 2023 18:35:47 +0300 Subject: [PATCH] [K/N] Do not check caches consistency until all of them are built #KT-60371 Fixed --- .../src/org/jetbrains/kotlin/backend/konan/CacheSupport.kt | 4 ++-- .../src/org/jetbrains/kotlin/backend/konan/KonanDriver.kt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CacheSupport.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CacheSupport.kt index 7f058038db55b..0d476ac87ae01 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CacheSupport.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CacheSupport.kt @@ -80,7 +80,7 @@ class PartialCacheInfo(val klib: KotlinLibrary, val strategy: CacheDeserializati class CacheSupport( private val configuration: CompilerConfiguration, - resolvedLibraries: KotlinLibraryResolveResult, + private val resolvedLibraries: KotlinLibraryResolveResult, ignoreCacheReason: String?, systemCacheDirectory: File, autoCacheDirectory: File, @@ -181,7 +181,7 @@ class CacheSupport( fun cacheFileId(fqName: String, filePath: String) = "${if (fqName == "") "ROOT" else fqName}.${filePath.hashCode().toString(Character.MAX_RADIX)}" } - init { + fun checkConsistency() { // Ensure dependencies of every cached library are cached too: resolvedLibraries.getFullList { libraries -> libraries.map { library -> diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanDriver.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanDriver.kt index 8c807e474a012..f672b6bc63e87 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanDriver.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanDriver.kt @@ -75,6 +75,8 @@ class KonanDriver( konanConfig = KonanConfig(project, configuration) // TODO: Just set freshly built caches. } + konanConfig.cacheSupport.checkConsistency() + DynamicCompilerDriver().run(konanConfig, environment) }