KT-49780 Do not clean outputs after cache corruption

This commit is contained in:
nataliya.valtman
2022-05-13 13:18:17 +03:00
committed by Space
parent 6c994787b3
commit dcdd1cd14e
2 changed files with 77 additions and 2 deletions
@@ -189,8 +189,10 @@ abstract class IncrementalCompilerRunner<
return exitCode
} catch (e: Exception) { // todo: catch only cache corruption
// todo: warn?
reporter.report { "Rebuilding because of possible caches corruption: $e" }
rebuild(BuildAttribute.CACHE_CORRUPTION)
reporter.report { "Possible caches corruption: $e" }
rebuild(BuildAttribute.CACHE_CORRUPTION).also {
cachesMayBeCorrupted = false
}
} finally {
if (cachesMayBeCorrupted) {
cleanOutputsAndLocalStateOnRebuild(args)