From 615db68d557c1b777ab12ee5ad275d4e1193ec47 Mon Sep 17 00:00:00 2001 From: Jan Chyb Date: Mon, 9 Sep 2024 15:16:42 +0200 Subject: [PATCH] Allow problems to be cleaned up after compiler crash --- backend/src/main/scala/bloop/Compiler.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/src/main/scala/bloop/Compiler.scala b/backend/src/main/scala/bloop/Compiler.scala index 39f0dbd86..0aa74d14e 100644 --- a/backend/src/main/scala/bloop/Compiler.scala +++ b/backend/src/main/scala/bloop/Compiler.scala @@ -46,6 +46,8 @@ import bloop.util.BestEffortUtils import bloop.util.BestEffortUtils.BestEffortProducts import bloop.rtexport.RtJarCache import java.nio.file.Paths +import java.io.PrintWriter +import java.io.StringWriter case class CompileInputs( scalaInstance: ScalaInstance, @@ -736,9 +738,13 @@ object Compiler { Result.Failed(failedProblems, None, elapsed, backgroundTasks, None) case t: Throwable => t.printStackTrace() + val sw = new StringWriter() + t.printStackTrace(new PrintWriter(sw)) + logger.info(sw.toString()) val backgroundTasks = toBackgroundTasks(backgroundTasksForFailedCompilation.toList) - Result.Failed(Nil, Some(t), elapsed, backgroundTasks, None) + val failedProblems = findFailedProblems(reporter, None) + Result.Failed(failedProblems, Some(t), elapsed, backgroundTasks, None) } } }