-
Notifications
You must be signed in to change notification settings - Fork 40
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
8256506: Create a standalone version of Nashorn for Java 15+ #3
Conversation
👋 Welcome back attila! A progress list of the required criteria for merging this PR into |
The
The Java-15 version I am using is:
|
Hi Peter, thanks for catching this! Yes, I forgot to add Ivy-related files to Git; it of course worked locally 😳. I fixed it up, can you give it another try? Thanks! |
Very understandable issue with the ivy build files. This time it failed later in the process due to an issue with
|
Hm, I can't reproduce this problem with a clean build. Ivy doesn't even download For me
Note how my output says "5 artifacts copied" while yours says "13 artifacts copied". Indeed,
|
Here is my log file for the
The full file list that are showing in the dependencies list are:
|
You definitely hit on something. Implicit environmental dependencies apparently abound on my machine. Running Removing it switched to using another implicit version, this time 2.4.0 from I decided at this point that using Ivy is not worth it after all, and have reverted to manual dependency management for now. |
@szegedi That time the build completed, but I don't have a chance to test the functionality today. There were a few warnings during the build. module-info declaration referencing
javadoc for
|
@ansell thank you for all the work so far trying this out! Those warnings are benign and I won't be addressing them:
I opted to separately compile nashorn-core and shell, so core is not aware of shell when it declares exports to it. It emits the exports correctly, though.
Yeah, it complains that some private fields are not documented. I believe the only reason for this is that, extending I agree these are somewhat annoying, but not blockers for the initial release. |
Hi Attila, I tried building the stand-alone Nashorn from this PR. It was a very smooth ride; apart from the warnings already mentioned, there were no issues. My build environment is macOS Mojave, with ant 1.10.9 from homebrew. As confirmation of the build result, I tried launching the shell. It turned out that Let me know if you need assistance in peeling off the build files from the common JDK build system that are no longer needed for the stand-alone Nashorn. |
ant clean; ant target is fine. (build of jar and tests is okay) When I applied diff on my local repo I got few whitespace issues. Saw three warnings during build
|
Basic jrunscript works as well.. $ cd $nashorn/build/nashorn/dist $ jrunscript -J--module-path=.:../dependencies -J--add-modules=org.openjdk.nashorn |
@magicus wrote:
Hi Magnus, thanks for looking into this! I will update the description in the PR.
Thank you for offering it! It's not using the common JDK build system anymore as far as I can tell, but rather just directly the |
…ng to nashorn, jjs" This reverts commit 2c08386.
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.
Great work 'porting' Nashorn to build, test and run outside JDK 💯
- I skimmed through many rename change sets (randomly checking few files)
- We may need to revisit Nashorn internal class access from scripts (that currently failing sandbox test).
- Unsafe usage for anonymous class loading. Perhaps we should just get rid of that eventually (sooner the better)
I did build, ran tests and tried few things with jrunscript (and not "jjs" yet). All seem fine.
@szegedi This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
/integrate |
This is a PR with what are the minimal necessary changes required to publish the initial standalone Nashorn, version 15.0.0.
Emphasis on minimal necessary changes: the directory layout is the one as extracted from the JDK, and the build script is still based on Ant. This is therefore much less pretty than it could be, although it should be reasonable.
Main things to be aware of:
jdk.nashorn.*
packages have all been renamed toorg.openjdk.nashorn.*
jdk.scripting.nashorn
module is renamed toorg.openjdk.nashorn
jdk.scripting.nashorn.shell
module is renamed toorg.openjdk.nashorn.shell
jjs
. We also won't release the shell module binary initially but plan it for a subsequent minor release.Building
To build, use JDK 15 and Ant 1.9 or later with the following commands:
This will produce Nashorn artifacts ready for signing and release into Maven in
build/nashorn/artifacts
directory.Other interesting targets:
jar
andtest
.Using
If you want to try the code version in this PR with your existing Java app that uses Nashorn, make sure you put the directories containing Nashorn and ASM on the module path, e.g. if you're in the root directory of the project after the build, these can be found in
build/nashorn/dist
andbuild/nashorn/dependencies
directories, so a command line likeshould work.
Launching shell
It is possible to launch the shell in a way that gives you an approximation of
jjs
too, although this is currently considered unsupported as we didn't work out the kinks with it. This is why the command line for that looks a bit hairy, with additional module exports added so it can use the JDK-internal copy ofjline
:Note that you will first need to run
ant jar
in order to create thebuild/nashorn/dist/jjs.jar
asant artifacts
presently doesn't build the shell module.Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/nashorn pull/3/head:pull/3
$ git checkout pull/3