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

8337280: Include jdk.jsobject module with JavaFX #1529

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented Aug 2, 2024

Add the jdk.jsobject module to JavaFX. This module is currently delivered by the JDK, but will be terminally-deprecated in JDK 24 by JDK-8311530, which is out for review at openjdk/jdk#20555. We therefore plan to start delivering it with JavaFX in JavaFX 24.

Testing scenarios

Both JDK and JavaFX for some period of time, so we need to test various scenarios. I built and tested this PR branch with each of the following JDKs:

  1. JDK 23 or earlier (I used the default boot JDK, which is currently JDK 22.0.2); this JDK includes jdk.jsobject as a normal, non-upgradable module
  2. A locally-built JDK 24 from my 8311530-depr-jsobject branch, which has the fix for JDK-8311530; this JDK includes jdk.jsobject as a terminally-deprecated, upgradable module
  3. A locally-built JDK 24 from my WIP-rm-jsobject branch, which removes the jdk.jsobject module, and is therefore a prototype of what will happen in JDK 26 (or later) when it is removed from the JDK

I ran a build and test of JavaFX from this PR branch using each of the above JDKs. All tests pass.

I then took the JavaFX artifacts built by JDK 1 (matching how we will deliver this in JavaFX 24), and ran the following additional tests, all of which match my expectations:

  • java --module-path=.../jfx/build/sdk/lib without any additional flags (required for JDK 1; recommended for JDK 3)
    RESULT: JDKs 1 and 2 use the jdk.jsobject module from the JDK; JDK 3 uses the jdk.jsobject module from JavaFX
  • java --module-path=.../jfx/build/sdk/lib --upgrade-module-path=.../jfx/build/sdk/lib (recommended for JDK 2, OK for 3)
    RESULT: JDK 1 will fail to launch; JDKs 2 and 3 use the jdk.jsobject module from JavaFX
  • jlink with .../jfx/build/jmods ahead of $JAVA_HOME/jmods (recommended for JDKs 2 and 3)
    RESULT: JDK 1 will fail to link; JDKs 2 and 3 use the jdk.jsobject module from JavaFX
  • jlink with $JAVA_HOME/jmods ahead of .../jfx/build/jmods (required for JDK 1)
    RESULT: JDKs 1 and 2 will use the jdk.jsobject module from the JDK; JDK 3 uses the jdk.jsobject module from JavaFX

I have not verified the maven artifacts, but they are being generated correctly.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8338249 to be approved
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issues

  • JDK-8337280: Include jdk.jsobject module with JavaFX (Enhancement - P4)
  • JDK-8338249: Include jdk.jsobject module with JavaFX (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1529/head:pull/1529
$ git checkout pull/1529

Update a local copy of the PR:
$ git checkout pull/1529
$ git pull https://git.openjdk.org/jfx.git pull/1529/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1529

View PR using the GUI difftool:
$ git pr show -t 1529

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1529.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 2, 2024

👋 Welcome back kcr! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 2, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

Comment on lines +50 to +52
static {
System.err.println("KCR: JavaFX version of jdk.jsobject loaded");
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This debug print statement is there to make it easy to see if the JavaFX version of this class is being loaded. I'll leave it during testing and review, but I'll remove it before the final review.

@openjdk openjdk bot added the csr Need approved CSR to integrate pull request label Aug 12, 2024
@kevinrushforth
Copy link
Member Author

/reviewers 2

@openjdk
Copy link

openjdk bot commented Sep 5, 2024

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@kevinrushforth kevinrushforth marked this pull request as ready for review September 5, 2024 21:13
@openjdk openjdk bot added the rfr Ready for review label Sep 5, 2024
@mlbridge
Copy link

mlbridge bot commented Sep 5, 2024

Webrevs

settings.gradle Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update to copyright year has been reverted by commit 33355b4.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember why I did that, but I'll redo the change to 2024. Thanks.

@AnirvanSarkar
Copy link
Member

Old version of classes netscape.javascript.JSObject and netscape.javascript.JSException seems to be delivered with JavaFX for Android [1].

Should these classes be removed?

[1] : https://github.com/openjdk/jfx/tree/jfx23/modules/javafx.web/src/android/java/netscape/javascript

@mlbridge
Copy link

mlbridge bot commented Sep 6, 2024

Mailing list message from Johan Vos on openjfx-dev:

Hi Kevin,

Thanks for the extensive checks on these scenario's. I believe the scenario
where jlink is used with an "old" JDK (e.g. 21) in combination with the
most recent JavaFX release is very common. In that case, it seems to be
required to prepend the module path with $JAVA_HOME/jmods, correct?
If that is the case, we need to announce and explain it very well, as
developers will run into it and get confused.

- Johan

Op do 5 sep 2024 om 23:18 schreef Kevin Rushforth <kcr at openjdk.org>:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20240906/56eed1be/attachment-0001.htm>

@kevinrushforth
Copy link
Member Author

Old version of classes netscape.javascript.JSObject and netscape.javascript.JSException seems to be delivered with JavaFX for Android [1].

Should these classes be removed?

[1] : https://github.com/openjdk/jfx/tree/jfx23/modules/javafx.web/src/android/java/netscape/javascript

I'll let @johanvos speak to that. If this is desired, then it's probably best done as a follow-up, since I can't test the Android (or iOS) implementation.

@kevinrushforth
Copy link
Member Author

I believe the scenario where jlink is used with an "old" JDK (e.g. 21) in combination with the most recent JavaFX release is very common. In that case, it seems to be required to prepend the module path with $JAVA_HOME/jmods, correct?

Yes.

If that is the case, we need to announce and explain it very well, as developers will run into it and get confused.

Agreed. I've marked this RFE as needing a release note, and will be sure to clarify this.

@johanvos
Copy link
Collaborator

johanvos commented Sep 8, 2024

Old version of classes netscape.javascript.JSObject and netscape.javascript.JSException seems to be delivered with JavaFX for Android [1].
Should these classes be removed?
[1] : https://github.com/openjdk/jfx/tree/jfx23/modules/javafx.web/src/android/java/netscape/javascript

I'll let @johanvos speak to that. If this is desired, then it's probably best done as a follow-up, since I can't test the Android (or iOS) implementation.

Yes, those can be removed. There is more (ios/android) code that can be removed, or that even should be removed. I'll file a follow-up for this.

@johanvos
Copy link
Collaborator

johanvos commented Sep 8, 2024

Old version of classes netscape.javascript.JSObject and netscape.javascript.JSException seems to be delivered with JavaFX for Android [1].
Should these classes be removed?
[1] : https://github.com/openjdk/jfx/tree/jfx23/modules/javafx.web/src/android/java/netscape/javascript

I'll let @johanvos speak to that. If this is desired, then it's probably best done as a follow-up, since I can't test the Android (or iOS) implementation.

Yes, those can be removed. There is more (ios/android) code that can be removed, or that even should be removed. I'll file a follow-up for this.

Created https://bugs.openjdk.org/browse/JDK-8339705 for this

@kevinrushforth
Copy link
Member Author

After merging in the latest master yesterday, I discovered that the recently-enabled javac lint warnings and -Werror when compiling the test classes will fail the build with "removal" warnings for those tests that use JSObject, when I run using my JDK 24 build with the patch from openjdk/jdk#20555. This is a good thing, since it means that those tests were not using the version of jdk.jsojbect from JavaFX. This highlights the needs to use --upgradle-module-path in our unit tests when running with JDK 24, so I pushed a commit that does that.

I'm done with my testing, and will switch to creating the CSRs.

Reviewers: @arapte @jaybhaskar

@kevinrushforth
Copy link
Member Author

I've created the CSRs for both the this PR and openjdk/jdk#20555.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
csr Need approved CSR to integrate pull request rfr Ready for review
Development

Successfully merging this pull request may close these issues.

4 participants