Skip to content

Commit

Permalink
Upgrade to latest GraalJS version (#5153)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-adam authored Jan 23, 2024
1 parent 7ac77bf commit 392bf29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
15 changes: 1 addition & 14 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 10 additions & 8 deletions core/src/org/labkey/core/wiki/MarkdownServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,18 @@ public class MarkdownServiceImpl implements MarkdownService

private static class PoolFactory implements KeyedPoolableObjectFactory<Map<Options, Boolean>, 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, Boolean> options) throws Exception
{
Expand All @@ -61,13 +70,6 @@ public MarkdownInvocable makeObject(Map<Options, Boolean> 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");
Expand Down

0 comments on commit 392bf29

Please sign in to comment.