Skip to content
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

[NETBEANS-1159] Using UPL licensed graal-js-parser. #1407

merged 7 commits into from Aug 8, 2019


Copy link

JaroslavTulach commented Aug 6, 2019

I've took the first UPL version of the graal.js parser and modified it to work with current NetBeans JavaScript editing infrastructure. Then I created Graal.js JAR using folling steps:

$ git clone
$ cd graaljs/
graaljs$ git checkout e20fe15
graaljs$ ant
graaljs$ ls -l graal-js/mxbuild/dists/graal-js-parser.jar

Since e20fe15 there is an Ant script to perform the build. I compiled with JDK8.

The graal-js-parser has been uploaded as F500B932961B227F74352474D23F905EC52F112E-graal-js-parser-e20fe15.jar to our binaries set and this pull request is using it.

@JaroslavTulach JaroslavTulach self-assigned this Aug 6, 2019

This comment has been minimized.

Copy link

sdedic commented Aug 6, 2019

We probably do not need customizations in webcommon/libs.nashorn/build.xml either, since JS parser lib can be part of the regular build (?)


This comment has been minimized.

Copy link

junichi11 commented Aug 6, 2019

@JaroslavTulach Maybe, php.editor also needs the fix?



This comment has been minimized.

Copy link

geertjanw commented Aug 6, 2019

This is great, no more need for the user to install the parser themselves.

sdedic approved these changes Aug 6, 2019
Copy link

sdedic left a comment

Great !


This comment has been minimized.

Copy link

matthiasblaesing commented Aug 6, 2019

Thank you - a build worked and starting with a clean userdir, all JS features were directly accessible (nice!). I had a first look at the sources and this is what I noticed:

Build from source fails

mx still feels alien to me and I failed to build graal.js from source:

matthias@athena:~/src/graaljs/graal-js$ mx build --project GRAAL_JS_PARSER
Traceback (most recent call last):
  File "/home/matthias/src/mx/", line 19726, in <module>
  File "/home/matthias/src/mx/", line 19613, in main
    primary = _discover_suites(primarySuiteMxDir, load=should_load_suites)
  File "/home/matthias/src/mx/", line 3364, in _discover_suites
  File "/home/matthias/src/mx/", line 3362, in _register_visit
  File "/home/matthias/src/mx/", line 1506, in _load
  File "/home/matthias/src/mx/", line 1931, in _load_extensions
    mod = __import__(extensionsName)
  File "/home/matthias/src/graaljs/graal-js/mx.graal-js/", line 338, in <module>
TypeError: __init__() takes at least 6 arguments (5 given)

Am I missing something?

License information

A quick check of the licenses (aka grep -lr "GNU General " *) gave me:

GPL license header:

GPL license file:

GPL+UPL header, without indication that the file is dual licensed:

GPL+UPL+BSD license:

There are other licenses on graal-nodejs, I hope, that no code outside graal-js is used for graal-js.


This comment has been minimized.

Copy link
Contributor Author

JaroslavTulach commented Aug 7, 2019

Thanks for the detailed review, @matthiasblaesing. The TypeError: __init__() takes at least 6 arguments (5 given) problem has something to do with old/new version of mx. I have seen it as well before (but not when writing the above steps). The workaround was:

graal-js$ git diff
diff --git a/graal-js/mx.graal-js/ b/graal-js/mx.graal-js/
index bb59b035d7..ae60755801 100644
--- a/graal-js/mx.graal-js/
+++ b/graal-js/mx.graal-js/
@@ -331,12 +331,6 @@ mx_sdk.register_graalvm_component(mx_sdk.GraalVmLanguage(
-        mx_sdk.LanguageLauncherConfig(
-            destination='bin/<exe:js>',
-            jar_distributions=['graal-js:GRAALJS_LAUNCHER'],
-            main_class='',
-            build_args=['--language:js']
-        )

Thanks for the license check. Yes, the graal-js/src/ and graal-js/src/ are an oversight. It has just been fixed in cdbd80a95. The other files are unrelated and I'd rather leave them without any modification. They aren't used in the parser anyway. When I run:

graaljs/graal-js$ mx clean
graaljs/graal-js$ mx -v build --project GRAAL_JS_PARSER
javac -g -d mxbuild/src/ -classpath  
-parameters -proc:none -target 1.8 -source 1.8 
-Xlint:none -XDignore.symbol.file -encoding UTF-8 -Xmaxerrs 10000

e.g. it should be enough to run just the javac and then package the source and resource files somehow:

$ /jdk1.8.0/bin/javac -g -d mxbuild/src/ 
-classpath  -parameters -proc:none -target 1.8 -source 1.8 
-Xlint:none -XDignore.symbol.file -encoding UTF-8 -Xmaxerrs 10000

The javafilelist.txt contains only files under the src/ directory, so licenses of other files shall not matter.

Copy link

matthiasblaesing left a comment

Thank you for the walk through to handling mx. The change to indeed caused the build to succeed. I build from source and ran the resulting jar and the jar included into the netbeans build through diffoscope ( The jars are identical (excluding ordering/time differenzes in the jar directory).

I agree, that and are the files, that really need the license update (even if we would bundle the source for the parser, we could replace mx with a trival ant script, as you already demonstrated).

I'd like to ask you to rebuild the binaries from your new tag and switch to that binary. We learned, that some folks get grumpy if they see the GPL and the parser binary caries it in the

Apart from that I think this is a great improvement.

@JaroslavTulach JaroslavTulach merged commit bba551d into apache:master Aug 8, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
@JaroslavTulach JaroslavTulach deleted the JaroslavTulach:jtulach/UplParser branch Aug 8, 2019
@junichi11 junichi11 added this to the 11.2 milestone Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.