-
Notifications
You must be signed in to change notification settings - Fork 283
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
Add runtime using GraalJS on TruffleRuby #107
Conversation
6c16c8f
to
13d3c5d
Compare
This PR is ready now. |
I'll try to find some time today. |
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.
Looks quite straight forward to me. I'm not a fan to have to include a -head
version on CI because GitHub Actions have no proper "allow failures" feature, but I suppose that's ok.
I'll leave it a couple days for @pixeltrix to chime in if he wants to, if not I'll happily merge, I can't release though.
I could switch to the the non-head version when 21.3 is released on October 19. |
Sounds good. |
@eregon could you rebase? I fixed the jscore test suite on master. |
And sorry for the delay, this slipped my mind. |
@byroot Will do, but I'll wait for the release which should come later today, so then we can test against a release in CI :) |
* Use Truffle inner contexts to provide correct isolation between ExecJS::Context * To run the tests: TRUFFLERUBYOPT="--jvm --polyglot" bundle exec rake test:graaljs TESTOPTS="--seed=0 --verbose" * Full command without subprocess: TRUFFLERUBYOPT="--jvm --polyglot" jt -u jvm-js ruby -w -Ilib:test -I $PWD/vendor/bundle/truffleruby/*/gems/rake-13.0.1/lib $PWD/vendor/bundle/truffleruby/*/gems/rake-13.0.1/lib/rake/rake_test_loader.rb test/test_execjs.rb --seed=0 --verbose * Try command: TRUFFLERUBYOPT="--jvm --polyglot" jt -u jvm-js ruby -Ilib -rexecjs -e 'p ExecJS.eval("2 + 3")'
* If the GraalJSRuntime is not used it is not necessarily an issue, as it e.g. fall back to an ExternalRuntime like node.
db2490c
to
313ffba
Compare
732a5e3
to
8d4412a
Compare
@byroot All good now, and the CI passes on my fork: https://github.com/eregon/execjs/runs/3942801077?check_suite_focus=true#step:9:21 |
This PR adds a new runtime for ExecJS when running on TruffleRuby in JVM mode and Graal.js is available.
So it needs
truffleruby+graalvm
and alsoexport TRUFFLERUBYOPT=--jvm --polyglot
. The standalonetruffleruby
does not include Graal.js.This new backend evaluates everything in-process much like the
mini_racer
backend.ExecJS's Context are correctly isolated by using Truffle inner contexts.
All tests pass: https://github.com/eregon/execjs/runs/3688209195?check_suite_focus=true#step:9:72