From 030dbe4973410e43dfda6b10ee60b9c2a320ac76 Mon Sep 17 00:00:00 2001 From: Jaroslav Tulach Date: Thu, 1 Dec 2022 07:43:13 +0100 Subject: [PATCH] Disabling musl as it isn't capable to load dynamic library (#3917) Disabling `musl` as it isn't capable to load dynamic library. # Important Notes With this change it is possible to: ``` $ sbt bootstrap $ sbt engine-runner/buildNativeImage $ ./runner --run ./engine/runner/src/test/resources/Factorial.enso 3 6 $ ./runner --run ./engine/runner/src/test/resources/Factorial.enso 4 24 $ ./runner --run ./engine/runner/src/test/resources/Factorial.enso 100 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 ``` Is it OK, @radeusgd to disable `musl`? If not, we would have to find a way to link the parser in statically, not dynamically. --- build.sbt | 5 +++-- .../src/main/java/org/enso/compiler/EnsoCompiler.java | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 362151c72ec..e2d83c90c73 100644 --- a/build.sbt +++ b/build.sbt @@ -1636,7 +1636,7 @@ lazy val `engine-runner` = project rebuildNativeImage := NativeImage .buildNativeImage( "runner", - staticOnLinux = true, + staticOnLinux = false, additionalOptions = Seq( "-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog", "-H:IncludeResources=.*Main.enso$", @@ -1652,7 +1652,8 @@ lazy val `engine-runner` = project initializeAtRuntime = Seq( // Note [WSLoggerManager Shutdown Hook] "org.enso.loggingservice.WSLoggerManager$", - "io.methvin.watchservice.jna.CarbonAPI" + "io.methvin.watchservice.jna.CarbonAPI", + "org.enso.syntax2.Parser" ) ) .dependsOn(installNativeImage) diff --git a/engine/runtime/src/main/java/org/enso/compiler/EnsoCompiler.java b/engine/runtime/src/main/java/org/enso/compiler/EnsoCompiler.java index c40c88a5f54..0634be9087d 100644 --- a/engine/runtime/src/main/java/org/enso/compiler/EnsoCompiler.java +++ b/engine/runtime/src/main/java/org/enso/compiler/EnsoCompiler.java @@ -13,6 +13,7 @@ public final class EnsoCompiler implements AutoCloseable { try { p = Parser.create(); } catch (LinkageError err) { + err.printStackTrace(); p = null; } this.parser = p;