From 4d392b1b0bb866b5714340b498cc429a483755b1 Mon Sep 17 00:00:00 2001 From: LepilkinaElena Date: Fri, 10 Apr 2020 12:10:43 +0300 Subject: [PATCH] Hint for users about disabling caches (#4082) --- .../src/org/jetbrains/kotlin/backend/konan/Linker.kt | 12 +++++++++++- .../jetbrains/kotlin/konan/exec/ExecuteCommand.kt | 3 +-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Linker.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Linker.kt index d4e84e131cd..3766b115e6e 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Linker.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Linker.kt @@ -133,7 +133,17 @@ internal class Linker(val context: Context) { it.execute() } } catch (e: KonanExternalToolFailure) { - context.reportCompilationError("${e.toolName} invocation reported errors\n${e.message}") + val extraUserInfo = + if (caches.static.isNotEmpty() || caches.dynamic.isNotEmpty()) + """ + Please try to disable compiler caches and rerun the build. To disable compiler caches, add the following line to the gradle.properties file in the project's root directory: + + kotlin.native.cacheKind=none + + Also, consider filing an issue with full Gradle log here: https://kotl.in/issue + """.trimIndent() + else "" + context.reportCompilationError("${e.toolName} invocation reported errors\n$extraUserInfo\n${e.message}") } return executable } diff --git a/shared/src/main/kotlin/org/jetbrains/kotlin/konan/exec/ExecuteCommand.kt b/shared/src/main/kotlin/org/jetbrains/kotlin/konan/exec/ExecuteCommand.kt index ffe19eb3206..27e93f9d86c 100644 --- a/shared/src/main/kotlin/org/jetbrains/kotlin/konan/exec/ExecuteCommand.kt +++ b/shared/src/main/kotlin/org/jetbrains/kotlin/konan/exec/ExecuteCommand.kt @@ -111,8 +111,7 @@ open class Command(initialCommand: List) { if (code != 0) throw KonanExternalToolFailure(""" The ${command[0]} command returned non-zero exit code: $code. output: - ${output.joinToString("\n")} - """.trimIndent(), command[0]) + """.trimIndent() + "\n${output.joinToString("\n")}", command[0]) // Show warnings in case of success linkage. if (stdError.isNotEmpty()) { stdError.joinToString("\n").also { message ->