From c963a8092462903e5490a4f0d838e3e4669b8773 Mon Sep 17 00:00:00 2001 From: Sam Gammon Date: Sat, 8 Mar 2025 20:16:29 -0800 Subject: [PATCH] fix(cli): native image boot to repl Fixes and closes elide-dev/elide#1270 Relates-to: #1270 Signed-off-by: Sam Gammon --- packages/cli/build.gradle.kts | 3 +-- .../dev/elide/elide-cli/reachability-metadata.json | 14 +++++++++++++- .../core/internals/graalvm/GraalVMEngine.kt | 6 +++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/cli/build.gradle.kts b/packages/cli/build.gradle.kts index 608a500eb..e108eab06 100644 --- a/packages/cli/build.gradle.kts +++ b/packages/cli/build.gradle.kts @@ -139,7 +139,7 @@ val enableFfm = hostIsLinux && System.getProperty("os.arch") != "aarch64" val enableEmbeddedResources = false val enableResourceFilter = false val enableAuxCache = false -val enableAuxCacheTrace = true +val enableAuxCacheTrace = false val enableJpms = false val enableConscrypt = false val enableBouncycastle = false @@ -1121,7 +1121,6 @@ val commonNativeArgs = listOfNotNull( "-H:ExcludeResources=elide/stream/.*\\.proto", "-H:ExcludeResources=elide/page/.*\\.proto", "-H:ExcludeResources=elide/vfs/.*\\.proto", - "-H:ExcludeResources=org/jline/.*", "-H:ExcludeResources=logback.xml", "-H:ExcludeResources=META-INF/native/libsqlite.*", "-H:ExcludeResources=lib/linux-x86_64/libbrotli.so", diff --git a/packages/cli/src/main/resources/META-INF/native-image/dev/elide/elide-cli/reachability-metadata.json b/packages/cli/src/main/resources/META-INF/native-image/dev/elide/elide-cli/reachability-metadata.json index 150bd1f3e..8c1a2ea7b 100644 --- a/packages/cli/src/main/resources/META-INF/native-image/dev/elide/elide-cli/reachability-metadata.json +++ b/packages/cli/src/main/resources/META-INF/native-image/dev/elide/elide-cli/reachability-metadata.json @@ -2918,7 +2918,15 @@ ], "resources": [ { - "glob": "sun/util/logging/resources/logging_en.properties" + "glob": "org/jline/utils/*.caps" + }, + { + "glob": "sun/util/logging/resources/logging_en.properties", + "module": "java.logging" + }, + { + "glob": "sun/util/logging/resources/logging_en_US.properties", + "module": "java.logging" }, { "glob": "META-INF/maven/org.jline/jline-native/pom.properties" @@ -3097,6 +3105,10 @@ "name": "com.sun.tools.javac.resources.compiler", "locales": ["en"] }, + { + "name": "sun.util.logging.resources.logging", + "locales": ["en", "en-US"] + }, { "name": "sun.tools.jar.resources.jar", "locales": ["en"] diff --git a/packages/graalvm/src/main/kotlin/elide/runtime/core/internals/graalvm/GraalVMEngine.kt b/packages/graalvm/src/main/kotlin/elide/runtime/core/internals/graalvm/GraalVMEngine.kt index 15c00fb20..f34bd4f1f 100644 --- a/packages/graalvm/src/main/kotlin/elide/runtime/core/internals/graalvm/GraalVMEngine.kt +++ b/packages/graalvm/src/main/kotlin/elide/runtime/core/internals/graalvm/GraalVMEngine.kt @@ -244,12 +244,16 @@ import org.graalvm.polyglot.HostAccess as PolyglotHostAccess /** Whether to emit trace messages for aux cache usage. */ private val traceCache = System.getProperty("elide.traceCache", "false") == "true" + /** Whether to use the auxiliary engine cache. */ + private val enableAuxCache = System.getProperty("elide.auxCache", "false") == "true" + /** Whether the auxiliary cache is actually enabled. */ private val useAuxCache = ( ENABLE_AUX_CACHE && + enableAuxCache && System.getProperty("elide.test") != "true" && System.getProperty("ELIDE_TEST") != "true" && - System.getProperty("elide.vm.engine.preinitialize") != "false" && // manual killswitch + System.getProperty("elide.vm.engine.preinitialize") != "false" && // manual kill-switch ImageInfo.inImageCode() && !ImageInfo.isSharedLibrary() && !Platform.includedIn(Platform.WINDOWS::class.java) // disabled on windows - not supported