[JS IR IC] Drop incremental cache after updating a klib set

Enabled Partial Linkage may replace entire IR expressions with a stub
during klib linking and loading. This may break the incremental cache
dependency graph. Dropping incremental cache files after updating klibs
(e.g. update klib version) covers almost all cases which
could not be tracked due to a broken dependency graph.

This patch could be reverted after fixing KT-57347
This commit is contained in:
Alexander Korepanov
2023-04-14 15:22:03 +02:00
committed by Space Team
parent c9badd14a7
commit 980d83eccd
22 changed files with 54 additions and 32 deletions
@@ -161,15 +161,8 @@ abstract class AbstractInvalidationTest(private val targetBackend: TargetBackend
val moduleSourceDir = File(sourceDir, module)
val moduleInfo = moduleInfos[module] ?: error("No module info found for $module")
val moduleStep = moduleInfo.steps.getValue(projStepId)
val deletedFiles = mutableSetOf<String>()
for (modification in moduleStep.modifications) {
modification.execute(moduleTestDir, moduleSourceDir) { deletedFiles.add(it.name) }
}
val expectedFileStats = moduleStep.expectedFileStats.toMutableMap()
if (deletedFiles.isNotEmpty()) {
val removedFiles = expectedFileStats[DirtyFileState.REMOVED_FILE.str] ?: emptySet()
expectedFileStats[DirtyFileState.REMOVED_FILE.str] = removedFiles + deletedFiles
modification.execute(moduleTestDir, moduleSourceDir) {}
}
val outputKlibFile = resolveModuleArtifact(module, buildDir)
@@ -196,7 +189,7 @@ abstract class AbstractInvalidationTest(private val targetBackend: TargetBackend
module.safeModuleName,
outputKlibFile.canonicalPath,
friends.map { it.canonicalPath },
expectedFileStats,
moduleStep.expectedFileStats,
dtsFile?.readText()
)
}