-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Nashorn with GraalVM #1857
Conversation
@madoar I don't know how to replace the |
Can you give me an example where you face the problems? |
E.g. in |
My IntelliJ doesn't seem to be able to find the |
With the import working it should be working with: public void run(ShortcutDTO shortcutDTO, List<String> arguments, Consumer<Exception> errorCallback) {
final InteractiveScriptSession interactiveScriptSession = scriptInterpreter.createInteractiveSession();
interactiveScriptSession.eval("include([\"engines\", \"wine\", \"shortcuts\", \"reader\"]);",
ignored -> interactiveScriptSession.eval("new ShortcutReader()", output -> {
final Value shortcutReader = (Value) output;
shortcutReader.invokeMember("of", shortcutDTO);
shortcutReader.invokeMember("run", arguments);
}, errorCallback), errorCallback);
} |
I had tried this before already but I got: PolyglotMap cannot be cast to PolyglotValue. I think you only get |
After pulling the newest changes from After debugging the code a little I identified the location of the problem. The problem is caused by the "cast" in: https://github.com/graalvm/graaljs/blob/0385428b1c2f2cc4212a85612435c2ea0f105488/graal-js/src/com.oracle.truffle.js.scriptengine/src/com/oracle/truffle/js/scriptengine/GraalJSScriptEngine.java#L205 As far as I found out I think that the best solution is to change our graal |
I've also tried that and got "Java is not defined". If you want to have a look, I can make a pr with my current state. |
- make PhoenicisScriptEngine an interface - cleanup ShortcutRunner - add some comments - change the constructor argument of the JSAScriptEngine class
Currently, I get
during an installation. |
Does this occur when "casting" the |
Notepad++. The installation starts just fine and installs the correct Wine version but then it crashes. I'm assuming that it happens in |
I can confirm my |
I just got:
when removing an installed application and container |
|
About your previous problem: The problem for me is that the responsible script code for this stuff spans 3+ files, which include both the engine "implementation" and "object" code. After following two or three invocations I don't know anymore if the |
I added some debug output but everything looked ok. The call hierarchy is not that difficult really: |
I found it. It's a bug in scripts. I will create a PR. |
Ok, I've experimented a bit. I can reproduce the exception(s). Interestingly they only seem to occur when executing Phoenicis from the IDE. If I install it via a built I believe the reason for the exception is a missing parameter which needs to be passed to the JVM. Somehow we set this parameter/option correctly inside the |
That's an interesting find. Nevertheless, I think it's something which should be fixed before we can merge this. |
I've searched some more but still can't find the reason for the error messages. The only think I found out is that the errors are thrown when parsing a javascript regex. For example an exception is thrown for the lines: phoenicis/phoenicis-scripts/src/main/resources/org/phoenicis/scripts/nashorn/builtins/utils.js Lines 26 to 27 in 2ee4666
I can't find any significant differences between my IntelliJ setup and the options the installer script sets. |
If you replace ALL_MODULE_PATH with jdk.crypto.ec,java.base,javafx.base,javafx.web,javafx.media,javafx.graphics,javafx.controls,java.naming,java.sql,java.scripting,jdk.scripting.nashorn,jdk.internal.vm.ci,jdk.internal.vm.compiler,org.graalvm.truffle,java.desktop,java.prefs,java.xml it should work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm replacing ALL_MODULE_PATH
with jdk.crypto.ec,java.base,javafx.base,javafx.web,javafx.media,javafx.graphics,javafx.controls,java.naming,java.sql,java.scripting,jdk.scripting.nashorn,jdk.internal.vm.ci,jdk.internal.vm.compiler,org.graalvm.truffle,java.desktop,java.prefs,java.xml
solves the problem.
@qparis do you know how the two settings differ? I mean I thought that ALL_MODULE_PATH
would auto-add all modules located on the module path?
Actually java.desktop,java.prefs,java.xml are not needed @madoar Seems that some module are not detected automatically with ALL-MODULE-PATH |
@plata Feel free to merge whenever you think we are stable enough. |
Do we need to update the IntelliJ IDEA documentation and and the flatpak? If so, what's the final list of required modules? |
The list of package is the same than than in the packaging script. |
@plata Can this be merged? |
I'm doing a quick test then I will merge, yes. |
Does it mean that it will not compile on Ubuntu? |
This is just for the IntelliJ IDEA documentation. Phoenicis itself is compiled with Java 11 already since b1b1ad5. |
Ok |
Apart from that: @madoar is using Ubuntu or Linux Mint so we should be fine. |
No description provided.