diff --git a/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt b/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt index 2fa802240ea..5b85b279eff 100644 --- a/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt +++ b/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt @@ -379,6 +379,8 @@ object KotlinCompilerClient { reportingTargets.report(DaemonReportCategory.DEBUG, "starting the daemon as: " + args.joinToString(" ")) val processBuilder = ProcessBuilder(args) processBuilder.redirectErrorStream(true) + val workingDir = File(daemonOptions.runFilesPath).apply { mkdirs() } + processBuilder.directory(workingDir) // assuming daemon process is deaf and (mostly) silent, so do not handle streams val daemon = launchProcessWithFallback(processBuilder, reportingTargets, "daemon client") diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt index 99b4a0e737f..1e38c77bc00 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt @@ -64,7 +64,12 @@ class KotlinGradleIT : BaseGradleIT() { val wd2 = createTempDir("testRunningInDifferentDir") wd1.copyRecursively(wd2) wd1.deleteRecursively() - assert(!wd1.exists()) + if (wd1.exists()) { + val files = buildString { + wd1.walk().forEach { appendln(" " + it.relativeTo(wd1).path) } + } + error("Some files in $wd1 were not removed:\n$files") + } wd0.setWritable(false) workingDir = wd2