Don't call File.getCanonicalPath in KGP
Relates to KT-54579.
This commit is contained in:
@@ -126,7 +126,7 @@ class FileAgeComparator : Comparator<File> {
|
||||
leftTS == 0L || rightTS == 0L -> 0 // cannot read any file timestamp, => undecidable
|
||||
leftTS > rightTS -> -1
|
||||
leftTS < rightTS -> 1
|
||||
else -> compareValues(left.canonicalPath, right.canonicalPath)
|
||||
else -> compareValues(left.normalize().absolutePath, right.normalize().absolutePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1063,7 +1063,7 @@ class CompileServiceImpl(
|
||||
}
|
||||
daemon.scheduleShutdown(true)
|
||||
} catch (e: Throwable) {
|
||||
log.info("Cannot connect to a daemon, assuming dying ('${runFile.canonicalPath}'): ${e.message}")
|
||||
log.info("Cannot connect to a daemon, assuming dying ('${runFile.normalize().absolutePath}'): ${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -527,7 +527,7 @@ class CompileServiceServerSideImpl(
|
||||
daemon.scheduleShutdown(true)
|
||||
log.fine("other : SHUTDOWN_OK")
|
||||
} catch (e: Throwable) {
|
||||
log.info("Cannot connect to a daemon, assuming dying ('${runFile.canonicalPath}'): ${e.message}")
|
||||
log.info("Cannot connect to a daemon, assuming dying ('${runFile.normalize().absolutePath}'): ${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class BuildReportICReporter(
|
||||
icLogLines.add("Compile iteration:")
|
||||
for (file in sourceFiles) {
|
||||
val reason = recompilationReason[file]?.let { " <- $it" } ?: ""
|
||||
icLogLines.add(" ${file.relativeOrCanonical()}$reason")
|
||||
icLogLines.add(" ${file.relativeOrAbsolute()}$reason")
|
||||
}
|
||||
recompilationReason.clear()
|
||||
}
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ internal class BuildReportICReporterAsync(
|
||||
icLogLines.add("Compile iteration:")
|
||||
for (file in sourceFiles) {
|
||||
val reason = recompilationReason[file]?.let { " <- $it" } ?: ""
|
||||
icLogLines.add(" ${file.relativeOrCanonical()}$reason")
|
||||
icLogLines.add(" ${file.relativeOrAbsolute()}$reason")
|
||||
}
|
||||
recompilationReason.clear()
|
||||
}
|
||||
|
||||
+1
-1
@@ -435,7 +435,7 @@ abstract class IncrementalCompilerRunner<
|
||||
|
||||
dirtySources.addAll(compiledSources)
|
||||
allDirtySources.addAll(dirtySources)
|
||||
val text = allDirtySources.joinToString(separator = System.getProperty("line.separator")) { it.canonicalPath }
|
||||
val text = allDirtySources.joinToString(separator = System.getProperty("line.separator")) { it.normalize().absolutePath }
|
||||
dirtySourcesSinceLastTimeFile.writeText(text)
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import java.io.File
|
||||
|
||||
object FileSnapshotExternalizer : DataExternalizer<FileSnapshot> {
|
||||
override fun save(out: DataOutput, value: FileSnapshot) {
|
||||
out.writeUTF(value.file.canonicalPath)
|
||||
out.writeUTF(value.file.normalize().absolutePath)
|
||||
out.writeLong(value.length)
|
||||
out.writeInt(value.hash.size)
|
||||
out.write(value.hash)
|
||||
|
||||
Reference in New Issue
Block a user