Skip to content

8337143: (fc, fs) Move filesystem-related native objects from libnio to libjava #20317

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

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

Conversation

bplb
Copy link
Member

@bplb bplb commented Jul 24, 2024

This proposed change would move the native objects required for NIO file interaction from the libnio native library to the libjava native library on Linux, macOS, and Windows.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (3 reviews required, with at least 1 Reviewer, 2 Authors)

Issue

  • JDK-8337143: (fc, fs) Move filesystem-related native objects from libnio to libjava (Sub-task - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20317

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20317.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 24, 2024

👋 Welcome back bpb! 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 Jul 24, 2024

@bplb This change is no longer ready for integration - check the PR body for details.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 24, 2024
@openjdk
Copy link

openjdk bot commented Jul 24, 2024

@bplb The following labels will be automatically applied to this pull request:

  • build
  • core-libs
  • net
  • nio
  • security

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@bplb
Copy link
Member Author

bplb commented Jul 24, 2024

This change passes CI tiers 1-5 jobs on all platforms. With the change in place, one can remove libnio from the JDK and still be able to copy a file using FileChannel. Without the change, doing this will result in throwing a java.lang.UnsatisfiedLinkError.

@mlbridge
Copy link

mlbridge bot commented Jul 24, 2024

@AlanBateman
Copy link
Contributor

/label remove security

@openjdk
Copy link

openjdk bot commented Jul 25, 2024

@AlanBateman
The security label was successfully removed.

@AlanBateman
Copy link
Contributor

I think this will require thinking about how to organize the native code in native/libjava as it hard to maintain if everything is in the same directory. We may have to create subdirectories, as we do in native/libnio.

Also think to work through some naming on IOUtil vs. NIOUtil as it won't be obvious to maintainers which class to use.

@bplb
Copy link
Member Author

bplb commented Jul 25, 2024

Yes, I was wondering about changing the organization of the native code files. It's not great to have them all in <platform>/native/libjava.

@bplb
Copy link
Member Author

bplb commented Jul 25, 2024

Perhaps <platform>/native/libjava/nio/ch and <platform>/native/libjava/nio/fs?

…unction of their original location in libnio
@bplb
Copy link
Member Author

bplb commented Jul 26, 2024

Also think to work through some naming on IOUtil vs. NIOUtil as it won't be obvious to maintainers which class to use.

Maybe NIOUtil should be NetUtil as its methods appear to be invoked only by classes involved in networking?

@bplb
Copy link
Member Author

bplb commented Aug 7, 2024

As part of 7e8a02e, the nio_util.h header files were modified. One unused symbolic constant was removed. Symbolic constants used in only one file were moved to that file. Function declarations that were only used where the function is defined were removed. Function declarations used in only one file other than the one where the function is defined were moved to an extern in that file. On Unix, one function declaration used in three files was moved to a new header file Net.h.

Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

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

Disclaimer: I have not tried to understand the proposed change in details. However I have spotted a small oddity.

@bplb
Copy link
Member Author

bplb commented Aug 9, 2024

Also think to work through some naming on IOUtil vs. NIOUtil as it won't be obvious to maintainers which class to use.

Maybe NIOUtil should be NetUtil as its methods appear to be invoked only by classes involved in networking?

Another option is NIONetUtil but the NIO prefix is redundant with the package name.

Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

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

The changes to the java/net code look OK to me now. Thanks Brian. I am approving these changes - but please also get a Reviewer for the NIO and build side of these.

@bplb bplb requested a review from djelinski September 16, 2024 16:16
Copy link
Member

@magicus magicus left a comment

Choose a reason for hiding this comment

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

Build changes still look good.

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 5, 2024

@bplb This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bplb
Copy link
Member Author

bplb commented Nov 5, 2024

continue;

@bplb
Copy link
Member Author

bplb commented Nov 20, 2024

The merge commit 403602f built and passed jdk_core tests on Linux, macOS, and Windows.

@openjdk
Copy link

openjdk bot commented Nov 27, 2024

@bplb this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout libjava
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Nov 27, 2024
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Nov 28, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 18, 2024

@bplb This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@magicus
Copy link
Member

magicus commented Jan 13, 2025

@AlanBateman I think what is holding this PR back is that you said you wanted to review it.

@AlanBateman
Copy link
Contributor

AlanBateman commented Jan 13, 2025

@AlanBateman I think what is holding this PR back is that you said you wanted to review it.

I asked Brian to hold off integrating this as I need time to work through several issues. Note that this is just one part of overall solution, we don't know yet if the changes in this PR will help the startup issue that motivated it (in isolation, the changes in this PR don't make sense of course).

@magicus
Copy link
Member

magicus commented Jan 13, 2025

I see.

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 10, 2025

@bplb This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bplb
Copy link
Member Author

bplb commented Feb 10, 2025

continue;

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 10, 2025

@bplb This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bplb
Copy link
Member Author

bplb commented Mar 10, 2025

continue;

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 8, 2025

@bplb This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented May 6, 2025

@bplb This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this May 6, 2025
@bplb
Copy link
Member Author

bplb commented May 6, 2025

/open

@openjdk openjdk bot reopened this May 6, 2025
@openjdk
Copy link

openjdk bot commented May 6, 2025

@bplb This pull request is now open

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 3, 2025

@bplb This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants