You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Ekaterina Dimitrova <e....@gmail.com> on 2021/09/09 21:15:34 UTC

[DISCUSS] Java 17 support - Nashorn removed

Hi team,

I started some initial work on the Java 17 support (CASSANDRA-16895).

One of the first observations is that Nashorn, which was already deprecated
in Java 11, is already fully removed. We use it for UDFs and one short
script <https://github.com/apache/cassandra/blob/trunk/build.xml#L147-L155>
in build.xml. The solution to that is to introduce graal as a dependency.
While graaljs is under UPL license, which is accepted by Apache, I believe
we also need the graal-sdk[2] which is under GPL2 which is not compatible
with Apache License, version 2.0. (Thanks Brandon for pointing that out)

For reference:

[1] https://www.graalvm.org/reference-manual/js/NashornMigrationGuide/

[2] https://github.com/oracle/graaljs/blob/master/docs/user/RunOnJDK.md

[3] https://ant.apache.org/manual/Tasks/script.html

[4]  https://www.apache.org/licenses/GPL-compatibility.html

At this point, I haven’t found any other substitution for Nashorn that can
fit our needs and while the build.xml issue can be possibly easily solved(I
guess), I am wondering what would be the right approach for the UDFs.

I am wondering what others think about that. Any
thoughts/experience/suggestions?

Best regards,

Ekaterina

Re: [DISCUSS] Java 17 support - Nashorn removed

Posted by Ekaterina Dimitrova <e....@gmail.com>.
Hey Aleksei,
Thank you so much for looking into this! Really appreciate it!
Indeed, maven says UPL but if you look at the License file here, it says
GPL2
https://github.com/oracle/graal

And now looking at the bottom of the Readme there is a table that says
particular components, including the sdk are under UPL. So seems we are
good to go.
Seems we got confused from the license file. GraalJS has separate repo and
UPL license file.
I think graal is the way to go.
Rhino is lower performance as far as I was reading and the official
recommendation everywhere is graal.

Thank you once again for your help and have a wonderful weekend!
Best regards,
Ekaterina

On Fri, 10 Sep 2021 at 4:50, Aleksei Zotov <az...@gmail.com> wrote:

> Hi Ekaterina,
>
> It seems *graal-sdk* is licensed under UPL license as well (see
> https://github.com/oracle/graal/tree/master/sdk):
> > GraalVM SDK is licensed under the Universal Permissive License.
> Also it is marked as UPL in Maven Central (see
> https://search.maven.org/artifact/org.graalvm.sdk/graal-sdk/21.2.0/jar).
>
> In fact, I checked all required components and they seem to have suitable
> licenses:
>
>    - https://mvnrepository.com/artifact/org.graalvm.js/js/21.2.0 (UPL)
>    - https://mvnrepository.com/artifact/com.ibm.icu/icu4j/69.1
>    (Unicode/ICU License)
>    - https://mvnrepository.com/artifact/org.graalvm.regex/regex/21.2.0
>    (UPL)
>    - https://mvnrepository.com/artifact/org.graalvm.sdk/graal-sdk/21.2.0
>    (UPL)
>    -
>    https://mvnrepository.com/artifact/org.graalvm.truffle/truffle-api/21.2.0
>    (UPL)
>    -
>    https://mvnrepository.com/artifact/org.graalvm.js/js-scriptengine/21.2.0
>    (UPL)
>
> I feel GraalVM would be the best option. However, if it is impossible to
> use it in the project we could consider the well-known old-timer Rhino.
> Looks like it is still alive and wants to get users back (see
> https://github.com/mozilla/rhino/blob/master/RELEASE-NOTES.md):
> > Now that Nashorn has been deprecated, a number of people have asked
> about using Rhino with the standard Java "ScriptEngine" interface. This
> release supports that.
> It is available under MPL 2.0 which seems to be compatible (need to double
> check this statement) with Apache 2.0.
>
>
> Thanks,
> Aleksei.
> On 9/10/21 1:15 AM, Ekaterina Dimitrova wrote:
>
> Hi team,
>
> I started some initial work on the Java 17 support (CASSANDRA-16895).
>
> One of the first observations is that Nashorn, which was already deprecated
> in Java 11, is already fully removed. We use it for UDFs and one short
> script <https://github.com/apache/cassandra/blob/trunk/build.xml#L147-L155> <https://github.com/apache/cassandra/blob/trunk/build.xml#L147-L155>
>
> in build.xml. The solution to that is to introduce graal as a dependency.
> While graaljs is under UPL license, which is accepted by Apache, I believe
> we also need the graal-sdk[2] which is under GPL2 which is not compatible
> with Apache License, version 2.0. (Thanks Brandon for pointing that out)
>
> For reference:
>
> [1] https://www.graalvm.org/reference-manual/js/NashornMigrationGuide/
>
> [2] https://github.com/oracle/graaljs/blob/master/docs/user/RunOnJDK.md
>
> [3] https://ant.apache.org/manual/Tasks/script.html
>
> [4]  https://www.apache.org/licenses/GPL-compatibility.html
>
> At this point, I haven’t found any other substitution for Nashorn that can
> fit our needs and while the build.xml issue can be possibly easily solved(I
> guess), I am wondering what would be the right approach for the UDFs.
>
> I am wondering what others think about that. Any
> thoughts/experience/suggestions?
>
> Best regards,
>
> Ekaterina
>
>
>

Re: [DISCUSS] Java 17 support - Nashorn removed

Posted by Aleksei Zotov <az...@gmail.com>.
Hi Ekaterina,

It seems /graal-sdk/ is licensed under UPL license as well (see 
https://github.com/oracle/graal/tree/master/sdk):
 > GraalVM SDK is licensed under the Universal Permissive License.
Also it is marked as UPL in Maven Central (see 
https://search.maven.org/artifact/org.graalvm.sdk/graal-sdk/21.2.0/jar).

In fact, I checked all required components and they seem to have 
suitable licenses:

  * https://mvnrepository.com/artifact/org.graalvm.js/js/21.2.0 (UPL)
  * https://mvnrepository.com/artifact/com.ibm.icu/icu4j/69.1
    (Unicode/ICU License)
  * https://mvnrepository.com/artifact/org.graalvm.regex/regex/21.2.0 (UPL)
  * https://mvnrepository.com/artifact/org.graalvm.sdk/graal-sdk/21.2.0
    (UPL)
  * https://mvnrepository.com/artifact/org.graalvm.truffle/truffle-api/21.2.0
    (UPL)
  * https://mvnrepository.com/artifact/org.graalvm.js/js-scriptengine/21.2.0
    (UPL)

I feel GraalVM would be the best option. However, if it is impossible to 
use it in the project we could consider the well-known old-timer Rhino. 
Looks like it is still alive and wants to get users back (see 
https://github.com/mozilla/rhino/blob/master/RELEASE-NOTES.md):
 > Now that Nashorn has been deprecated, a number of people have asked 
about using Rhino with the standard Java "ScriptEngine" interface. This 
release supports that.
It is available under MPL 2.0 which seems to be compatible (need to 
double check this statement) with Apache 2.0.


Thanks,
Aleksei.

On 9/10/21 1:15 AM, Ekaterina Dimitrova wrote:
> Hi team,
>
> I started some initial work on the Java 17 support (CASSANDRA-16895).
>
> One of the first observations is that Nashorn, which was already deprecated
> in Java 11, is already fully removed. We use it for UDFs and one short
> script <https://github.com/apache/cassandra/blob/trunk/build.xml#L147-L155>
> in build.xml. The solution to that is to introduce graal as a dependency.
> While graaljs is under UPL license, which is accepted by Apache, I believe
> we also need the graal-sdk[2] which is under GPL2 which is not compatible
> with Apache License, version 2.0. (Thanks Brandon for pointing that out)
>
> For reference:
>
> [1] https://www.graalvm.org/reference-manual/js/NashornMigrationGuide/
>
> [2] https://github.com/oracle/graaljs/blob/master/docs/user/RunOnJDK.md
>
> [3] https://ant.apache.org/manual/Tasks/script.html
>
> [4]  https://www.apache.org/licenses/GPL-compatibility.html
>
> At this point, I haven’t found any other substitution for Nashorn that can
> fit our needs and while the build.xml issue can be possibly easily solved(I
> guess), I am wondering what would be the right approach for the UDFs.
>
> I am wondering what others think about that. Any
> thoughts/experience/suggestions?
>
> Best regards,
>
> Ekaterina
>