-
Notifications
You must be signed in to change notification settings - Fork 231
8327476: Upgrade JLine to 3.26.1 #3292
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
Conversation
|
👋 Welcome back goetz! A progress list of the required criteria for merging this PR into |
|
@GoeLin 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: 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 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
|
This backport pull request has now been updated with issue from the original commit. |
Webrevs
|
TheRealMDoerr
left a comment
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.
Your modifications look reasonable.
|
|
|
Thanks for reviewing! |
|
/integrate |
|
Going to push as commit bb391d7.
Your commit was automatically rebased without conflicts. |
I backport this change for parity with 17.0.15-oracle.
It brings updates of upstream library jline 3.26.1 to jdk17.
Jdk17 currently includes jline 3.22.0, see JDK-8297587.
The original sources of jline 3.26.1 can be found here:
https://github.com/jline/jline3/archive/refs/tags/jline-parent-3.26.1.tar.gz
The backport of this change needed some adaptions.
The original jline library dynamically selects how to access
the operating system in two means:
The implementation in OpenJDK does this selection at JDK build time.
The code is split into more subdirectories for the operating systems.
One of the methods to call native is picked, the code for the others
is removed. Unfortunately this differs for the JDK releases:
jdk23 uses ffm.
jdk21 uses jna.
jdk17 uses jna on windows, "exec" on the remaining OSes.
"8306983: Do not invoke external programs when switch terminal to raw mode on selected platforms"
implemented the jna access for unix etc. in 21.
Because of these differences I had to adapt the change when
backporting from 23 to 21, and now I need to do so again.
I am basing my backport to 17 on the commit of this change in 21.
First, I just drop the changes to the files not in 17 that were added by 8306983:
aix/classes/jdk/internal/org/jline/terminal/impl/jna/JDKNativePty.java
linux/classes/jdk/internal/org/jline/terminal/impl/jna/JDKNativePty.java
linux/classes/jdk/internal/org/jline/terminal/impl/jna/linux/CLibrary.java
linux/classes/jdk/internal/org/jline/terminal/impl/jna/linux/LinuxNativePty.java
macosx/classes/jdk/internal/org/jline/terminal/impl/jna/JDKNativePty.java
macosx/classes/jdk/internal/org/jline/terminal/impl/jna/osx/CLibrary.java
macosx/classes/jdk/internal/org/jline/terminal/impl/jna/osx/OsXNativePty.java
unix/classes/jdk/internal/org/jline/terminal/impl/jna/JnaNativePty.java
unix/classes/jdk/internal/org/jline/terminal/impl/jna/JnaTerminalProvider.java
The remaining patch applied quite well, I only had to
resolve the following files:
src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Buffer.java
src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/LineReader.java
src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/BufferImpl.java
src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/impl/LineReaderImpl.java
Code that was added by "8321131: Console read line with zero out should zero out underlying buffer in JLine" or
"8321409: Console read line with zero out should zero out underlying buffer in JLine (redux)" is modified.
The two changes were not backported to 17, as JdkConsoleProviderImpl.java
which was added by "8295803: Console should be usable in jshell and other environments",
is not in 17. But now these JDK specific extensions have been added upstream.
So I add them to 17, too, to reduce differences.
src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractTerminal.java
Trivial resolve.
src/jdk.internal.le/windows/classes/jdk/internal/org/jline/terminal/impl/jna/win/JnaWinConsoleWriter.java
Trivial resolve of imports.
src/jdk.internal.le/windows/classes/jdk/internal/org/jline/terminal/impl/jna/win/JnaWinSysTerminal.java
Trivial resolves of imports and the rest of the chunk with the imports.
The only difference in these two files to jdk21 is the import of LastErrorException.
To make it compile, I needed to add import "Arrays"
to BufferImpl.java. See small extra commit.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/3292/head:pull/3292$ git checkout pull/3292Update a local copy of the PR:
$ git checkout pull/3292$ git pull https://git.openjdk.org/jdk17u-dev.git pull/3292/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3292View PR using the GUI difftool:
$ git pr show -t 3292Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/3292.diff
Using Webrev
Link to Webrev Comment