Fallback to ProcessBuilder when native ProcessLauncher fails
#KT-16902 fixed
This commit is contained in:
+10
-2
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.daemon.client
|
||||
|
||||
import net.rubygrapefruit.platform.Native
|
||||
import net.rubygrapefruit.platform.NativeException
|
||||
import net.rubygrapefruit.platform.ProcessLauncher
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||
@@ -386,8 +387,15 @@ object KotlinCompilerClient {
|
||||
val processBuilder = ProcessBuilder(args)
|
||||
processBuilder.redirectErrorStream(true)
|
||||
// assuming daemon process is deaf and (mostly) silent, so do not handle streams
|
||||
val daemonLauncher = Native.get(ProcessLauncher::class.java)
|
||||
val daemon = daemonLauncher.start(processBuilder)
|
||||
val daemon =
|
||||
try {
|
||||
val nativeLauncher = Native.get(ProcessLauncher::class.java)
|
||||
nativeLauncher.start(processBuilder)
|
||||
}
|
||||
catch (e: NativeException) {
|
||||
reportingTargets.report(DaemonReportCategory.DEBUG, "Could not start daemon with native process launcher, falling back to ProcessBuilder#start")
|
||||
processBuilder.start()
|
||||
}
|
||||
|
||||
val isEchoRead = Semaphore(1)
|
||||
isEchoRead.acquire()
|
||||
|
||||
Reference in New Issue
Block a user