From 71732afae092317c96fd10f979316dc1f70723e1 Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Tue, 28 Dec 2021 14:37:22 +0300 Subject: [PATCH] [JS IR] Copy JS artifacts to the build directory if the compiler crashes Previously in 3fb1096c18f2f1be82823ab7c997c8e6e9a8393b we've implemented dumping the IR after each phase when running JS IR box tests. However, because those dumps are saved to a temporary directory, they can be lost in case we never make it to `jsArtifactsHandlersStep` where files from that temporary directory were copied to the `build/out` directory. This could happen if, for example, the compiler crashed. In that case, having IR dumps is even more useful, as they can help investigate the crash. Here we make `JsArtifactsDumpHandler` an `AfterAnalysisChecker` so that it runs no matter what. --- .../js/test/AbstractJsBlackBoxCodegenTestBase.kt | 2 +- .../js/test/handlers/JsArtifactsDumpHandler.kt | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/AbstractJsBlackBoxCodegenTestBase.kt b/js/js.tests/test/org/jetbrains/kotlin/js/test/AbstractJsBlackBoxCodegenTestBase.kt index db236dccfb2..bd25a240e09 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/AbstractJsBlackBoxCodegenTestBase.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/AbstractJsBlackBoxCodegenTestBase.kt @@ -84,6 +84,7 @@ abstract class AbstractJsBlackBoxCodegenTestBase) { val originalFile = testServices.moduleStructure.originalTestDataFiles.first() val allDirectives = testServices.moduleStructure.allDirectives @@ -57,4 +57,4 @@ class JsArtifactsDumpHandler(testServices: TestServices) : JsBinaryArtifactHandl if (from.listFiles()?.size == 0) return from.copyRecursively(into, overwrite = true) } -} \ No newline at end of file +}