Building on Java 15, using graaljs in place of Nashorn

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Kartik Ohri <kartikohri13(at)gmail(dot)com>
Cc: pljava-dev(at)lists(dot)postgresql(dot)org
Subject: Building on Java 15, using graaljs in place of Nashorn
Date: 2020-06-21 22:42:05
Message-ID: 5EEFE23D.8080306@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

On 06/17/20 15:25, Chapman Flack wrote:
> That means it'll be time to add a profile with build-time dependencies
> on org.graalvm.js:js and org.graalvm.js:js-scriptengine. That ought to
> handle the uses of JS in the build itself (modulo whatever Nashorn ->
> GraalJS compatibility kinks we discover).

I have pushed a branch chore/master/denashorn that does that exactly,
when Java 15 or later is detected. It also sets the system property
polyglot.js.nashorn-compat, which lets the existing JavaScript bits
continue to work without any changes.

> Probably time to work on the self-installer Java code and just build in
> the work that is currently done in the included JS. That makes it less
> transparent and configurable, but it hasn't needed to change much in
> several years so it's probably ok.

I ended up refactoring it just slightly so it can be usefully subclassed,
then writing a PL/Java-specific subclass that handles the pathname mapping.
So now it's a self-extracting jar made by adding two extra .class files
rather than just one. Relatively painless.

Kartik, could you check that the branch works with Java 15 in CI?

Now that there is a small PL/Java-specific class file inside the
installer jar, I may go ahead and give it a few extra small methods
useful for testing, just so they could be run from jshell with a
classpath pointing to the jar. It would be a sensible place to put them.

Regards,
-Chap

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Kartik Ohri 2020-06-22 04:16:21 Re: Building on Java 15, using graaljs in place of Nashorn
Previous Message Chapman Flack 2020-06-21 20:08:43 apology from your moderator for large attachment