Skip to content

Commit

Permalink
Remove dirty output files when expanding IC scope early
Browse files Browse the repository at this point in the history
Previously IC could go to the next iteration without removing
outputs for the files compiled during the last iteration.
For example, it could happen, when a multifile part is changed
(we add sources for other parts and recompile everything together).

In case of MPP it could lead to compile error, because
the compiler would see the same actual declarations from dirty sources
and dirty outputs from previous iteration (which should have been removed).
That behaviour did not raise an error before dc8240c
because actual declarations from binaries (e.g. compile classpath) were ignored.

    #KT-35957 Fixed
  • Loading branch information
AlexeyTsvetkov committed Apr 18, 2020
1 parent 2442aba commit 4ccec52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ abstract class IncrementalCompilerRunner<
val additionalDirtyFiles = additionalDirtyFiles(caches, generatedFiles, services).filter { it !in dirtySourcesSet }
if (additionalDirtyFiles.isNotEmpty()) {
dirtySources.addAll(additionalDirtyFiles)
generatedFiles.forEach { it.outputFile.delete() }
continue
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@ Compiling files:
src/utilsActual.kt
src/utilsNoActual.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Class 'X' has several compatible actual declarations in modules <multifilePartChanged>, <multifilePartChanged>
Function 'foo' has several compatible actual declarations in modules <multifilePartChanged>, <multifilePartChanged>
Function 'useX' has several compatible actual declarations in modules <multifilePartChanged>, <multifilePartChanged>
Exit code: OK

0 comments on commit 4ccec52

Please sign in to comment.