From 4643d7fc4d91979370b06abbf5a5d4a5873a9f77 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Thu, 12 Nov 2015 17:13:26 +0100 Subject: [PATCH] Disabling parallel builds without daemon again and undoing apprpriate fix to broken tests problem, since it effectively cancelled fix for parallel building itself and was causing exceptions on heavy builds (cherry picked from commit 0610452) --- .../jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt | 2 +- .../org/jetbrains/kotlin/compilerRunner/CompilerRunnerUtil.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt index 8e651435738..1199383dacc 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt @@ -255,7 +255,7 @@ public class KotlinCoreEnvironment private constructor( val appEnv = getOrCreateApplicationEnvironmentForProduction(configuration, configFilePaths) // Disposing of the environment is unsafe in production then parallel builds are enabled, but turning it off universally // breaks a lot of tests, therefore it is disabled for production and enabled for tests - if (System.getProperty(KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY) == null || appEnv.application.isUnitTestMode) { + if (System.getProperty(KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY) == null) { // JPS may run many instances of the compiler in parallel (there's an option for compiling independent modules in parallel in IntelliJ) // All projects share the same ApplicationEnvironment, and when the last project is disposed, the ApplicationEnvironment is disposed as well Disposer.register(parentDisposable, object : Disposable { diff --git a/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/CompilerRunnerUtil.java b/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/CompilerRunnerUtil.java index 6f93cb03680..cc97d0376f3 100644 --- a/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/CompilerRunnerUtil.java +++ b/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/CompilerRunnerUtil.java @@ -70,7 +70,7 @@ public class CompilerRunnerUtil { } @Nullable - public static Object invokeExecMethod( + public synchronized static Object invokeExecMethod( @NotNull String compilerClassName, @NotNull String[] arguments, @NotNull CompilerEnvironment environment,