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

8280369: native library cache should be platform/arch specific #762

Closed
wants to merge 1 commit into from

Conversation

Glavo
Copy link
Contributor

@Glavo Glavo commented Mar 25, 2022

Currently, OpenJFX extracts the native library into a local folder and loads it when it is not part of the JRE.

Now we have a notable problem with the fact that a platform may actually run programs of multiple CPU architectures.

Most commonly, 32-bit x86 applications can be executed on Windows AMD64. In addition to this, ARM machines may also execute AMD64 programs by transpiling.

For OpenJFX of different architectures on the same system, their native libraries have the same file name, but their contents are different. Since they will try to unpack the native library into the same folder, this will cause file conflicts.

A practical example is when I run the same JavaFX application with both 32-bit and 64-bit Java on a Windows AMD64 platform, and the application that starts later crashes because it cannot unzip the native libraries:

Crash logs (The length exceeds the GitHub limit): https://paste.ubuntu.com/p/NZBK3pNrh7/

Here I avoid the problem by adding os.arch to the cache path.

I ran the tests on Ubuntu 20.04 after the modification and no tests were broken.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8280369: native library cache should be platform/arch specific

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/762/head:pull/762
$ git checkout pull/762

Update a local copy of the PR:
$ git checkout pull/762
$ git pull https://git.openjdk.java.net/jfx pull/762/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 762

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/762.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 25, 2022

👋 Welcome back Glavo! 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 Mar 25, 2022

⚠️ @Glavo a branch with the same name as the source branch for this pull request (master) is present in the target repository. If you eventually integrate this pull request then the branch master in your personal fork will diverge once you sync your personal fork with the upstream repository.

To avoid this situation, create a new branch for your changes and reset the master branch. You can do this by running the following commands in a local repository for your personal fork. Note: you do not have to name the new branch NEW-BRANCH-NAME.

$ git checkout -b NEW-BRANCH-NAME
$ git branch -f master d28f3d781a125eae7e89956ff8e37fc7b94646c2
$ git push -f origin master

Then proceed to create a new pull request with NEW-BRANCH-NAME as the source branch and close this one.

@Glavo Glavo changed the title Cache native libraries with architecture-dependent paths 8280369: Cache native libraries with architecture-dependent paths Mar 25, 2022
@openjdk openjdk bot added the rfr Ready for review label Mar 25, 2022
@Glavo Glavo changed the title 8280369: Cache native libraries with architecture-dependent paths 8280369: native library cache should be platform/arch specific Mar 25, 2022
@mlbridge
Copy link

mlbridge bot commented Mar 25, 2022

Webrevs

@kevinrushforth
Copy link
Member

This looks fine to me, but @johanvos or @tiainen will want to test it.

@johanvos
Copy link
Collaborator

This looks good, and I can't see possible regression (e.g. issues with non-existing parent directories, or files that have the same name as the directory that will be created by this PR). It is indeed very useful given the increase in potential architectures.
I'm doing a few more automatic tests before approving.

@openjdk
Copy link

openjdk bot commented Mar 29, 2022

@Glavo This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8280369: native library cache should be platform/arch specific

Reviewed-by: jvos

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 5 new commits pushed to the master branch:

  • 424aeba: 8277309: Add support for H.265/HEVC to HTTP Live Streaming
  • eb7fa5d: 8270867: Debug build of WebKit 613.1 fails on Linux
  • ff75917: 8283183: Skip failing PredefinedMeshManagerTest tests
  • 4afc8af: Merge
  • df43d2b: 8282766: Create release notes for JavaFX 18

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@johanvos) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Ready to be integrated label Mar 29, 2022
@Glavo
Copy link
Contributor Author

Glavo commented Mar 29, 2022

/integrate

@openjdk openjdk bot added the sponsor Ready to sponsor label Mar 29, 2022
@openjdk
Copy link

openjdk bot commented Mar 29, 2022

@Glavo
Your change (at version c1f6c99) is now ready to be sponsored by a Committer.

@johanvos
Copy link
Collaborator

/sponsor

@openjdk
Copy link

openjdk bot commented Mar 29, 2022

Going to push as commit a0db473.
Since your change was applied there have been 6 commits pushed to the master branch:

  • d1fb3d3: 8283517: Update boot JDK to 18
  • 424aeba: 8277309: Add support for H.265/HEVC to HTTP Live Streaming
  • eb7fa5d: 8270867: Debug build of WebKit 613.1 fails on Linux
  • ff75917: 8283183: Skip failing PredefinedMeshManagerTest tests
  • 4afc8af: Merge
  • df43d2b: 8282766: Create release notes for JavaFX 18

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 29, 2022
@openjdk openjdk bot closed this Mar 29, 2022
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review sponsor Ready to sponsor labels Mar 29, 2022
@openjdk
Copy link

openjdk bot commented Mar 29, 2022

@johanvos @Glavo Pushed as commit a0db473.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
3 participants