From 392bf2969ac14723b73e385fe89746bb622363ef Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Mon, 22 Jan 2024 23:19:22 -0500 Subject: [PATCH] Upgrade to latest GraalJS version (#5153) --- core/build.gradle | 15 +-------------- .../labkey/core/wiki/MarkdownServiceImpl.java | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/core/build.gradle b/core/build.gradle index ed2bbf7802a..ea43a91ed67 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -47,20 +47,7 @@ dependencies { BuildUtils.addExternalDependency( project, new ExternalDependency( - "org.graalvm.sdk:graal-sdk:${graalVersion}", - "GraalJS", - "GraalJS", - "https://github.com/graalvm/graaljs", - "Universal Permissive License", - "https://github.com/graalvm/graaljs/blob/master/LICENSE", - "Server-side JavaScript evaluation" - ) - ) - - BuildUtils.addExternalDependency( - project, - new ExternalDependency( - "org.graalvm.js:js:${graalVersion}", + "org.graalvm.polyglot:js-community:${graalVersion}", "GraalJS", "GraalJS", "https://github.com/graalvm/graaljs", diff --git a/core/src/org/labkey/core/wiki/MarkdownServiceImpl.java b/core/src/org/labkey/core/wiki/MarkdownServiceImpl.java index 18f3711bc80..2197c25a495 100644 --- a/core/src/org/labkey/core/wiki/MarkdownServiceImpl.java +++ b/core/src/org/labkey/core/wiki/MarkdownServiceImpl.java @@ -50,9 +50,18 @@ public class MarkdownServiceImpl implements MarkdownService private static class PoolFactory implements KeyedPoolableObjectFactory, MarkdownInvocable> { - public static final String POLYGLOT_ENGINE_WARN_INTERPRETER_ONLY = "polyglot.engine.WarnInterpreterOnly"; + static + { + // Issue 47679 - suppress stdout logging from GraalJS about compilation mode, due to significant difficulties + // in getting the VM configured to use compilation mode + if (System.getProperty(POLYGLOT_ENGINE_WARN_INTERPRETER_ONLY) == null) + { + System.setProperty(POLYGLOT_ENGINE_WARN_INTERPRETER_ONLY, "false"); + } + } + @Override public MarkdownInvocable makeObject(Map options) throws Exception { @@ -61,13 +70,6 @@ public MarkdownInvocable makeObject(Map options) throws Except if (null == svc) throw new ConfigurationException("LabKeyScriptEngineManager service not found."); - // Issue 47679 - suppress stdout logging from Graal about compilation mode, due to significant difficulties - // in getting the VM configured to use compilation mode - if (System.getProperty(POLYGLOT_ENGINE_WARN_INTERPRETER_ONLY) == null) - { - System.setProperty(POLYGLOT_ENGINE_WARN_INTERPRETER_ONLY, "false"); - } - ScriptEngine engine = svc.getEngineByName("graal.js"); if (null == engine) throw new ConfigurationException("Graal.js engine not found");