-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8303884: jlink --add-options plugin does not allow GNU style options to be provided #22526
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 henryjen! A progress list of the required criteria for merging this PR into |
|
@slowhog 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 131 new commits pushed to the
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. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
YaSuenag
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.
Looks good.
Thank you for working on this issue!
|
/reviewers 2 |
|
@AlanBateman |
src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
Outdated
Show resolved
Hide resolved
AlanBateman
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.
I was initially skeptical that this would be a small change, I had expected it would require significant re-working of the CLI code. Happy to be proved wrong.
| @@ -0,0 +1,148 @@ | |||
| /* | |||
| * Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved. | |||
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.
Hi @mlchung, thanks for making a comment in an OpenJDK project!
All comments and discussions in the OpenJDK Community must be made available under the OpenJDK Terms of Use. If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please Use "Add GitHub user mlchung" for the summary.
If you are not an OpenJDK Author, Committer or Reviewer, simply check the box below to accept the OpenJDK Terms of Use for your comments.
- I agree to the OpenJDK Terms of Use for all comments I make in a project in the OpenJDK GitHub organization.
Your comment will be automatically restored once you have accepted the OpenJDK Terms of Use.
| } | ||
| if (potentiallyGnuOption && param.length() >= 2 && | ||
| param.charAt(0) == '-' && param.charAt(1) == '-' && | ||
| !param.contains(" ")) { |
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.
Hi @mlchung, thanks for making a comment in an OpenJDK project!
All comments and discussions in the OpenJDK Community must be made available under the OpenJDK Terms of Use. If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please Use "Add GitHub user mlchung" for the summary.
If you are not an OpenJDK Author, Committer or Reviewer, simply check the box below to accept the OpenJDK Terms of Use for your comments.
- I agree to the OpenJDK Terms of Use for all comments I make in a project in the OpenJDK GitHub organization.
Your comment will be automatically restored once you have accepted the OpenJDK Terms of Use.
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.
--style argument still could be a real jlink argument, better check would be to see if that's a valid jlink option rather than just "--".
The other alternative would be like what proposed by @YaSuenag, simply take the next token as value.
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.
Hi @mlchung, thanks for making a comment in an OpenJDK project!
All comments and discussions in the OpenJDK Community must be made available under the OpenJDK Terms of Use. If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please Use "Add GitHub user mlchung" for the summary.
If you are not an OpenJDK Author, Committer or Reviewer, simply check the box below to accept the OpenJDK Terms of Use for your comments.
- I agree to the OpenJDK Terms of Use for all comments I make in a project in the OpenJDK GitHub organization.
Your comment will be automatically restored once you have accepted the OpenJDK Terms of Use.
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.
I agree it's a little bit awkward, unfortunately we cannot look at the quotation as that had been decoded by shell.
Just take next token as value would be simpler, see the origin PR from @YaSuenag at #19987.
The other alternative would be that, we can check next token against known options of jlink, and treat it as value without match. That would limited the potential ambiguous conflicts but would be even more mysterious to user?
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.
After the update, = must be used if value is prefixed with --.
--add-options=--add-modules=jdk.incubator.concurrent will work and --add-options="--add-modules=jdk.incubator.concurrent --module-path xx" will work, but not -add-options "--add-modules=jdk.incubator.concurrent --module-path xx"`.
| { "--raw-arg-plugin=--main-no-arg", "--main-no-arg" }, | ||
| { "--raw-arg-plugin", "--main-no-arg --list", "--main-no-arg"}, | ||
| { "--raw-arg-plugin", " --main-no-arg", "--main-no-arg" }, | ||
| }; |
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.
Hi @mlchung, thanks for making a comment in an OpenJDK project!
All comments and discussions in the OpenJDK Community must be made available under the OpenJDK Terms of Use. If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please Use "Add GitHub user mlchung" for the summary.
If you are not an OpenJDK Author, Committer or Reviewer, simply check the box below to accept the OpenJDK Terms of Use for your comments.
- I agree to the OpenJDK Terms of Use for all comments I make in a project in the OpenJDK GitHub organization.
Your comment will be automatically restored once you have accepted the OpenJDK Terms of Use.
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.
Line 126 validate the argument is processed.
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.
Hi @mlchung, thanks for making a comment in an OpenJDK project!
All comments and discussions in the OpenJDK Community must be made available under the OpenJDK Terms of Use. If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please Use "Add GitHub user mlchung" for the summary.
If you are not an OpenJDK Author, Committer or Reviewer, simply check the box below to accept the OpenJDK Terms of Use for your comments.
- I agree to the OpenJDK Terms of Use for all comments I make in a project in the OpenJDK GitHub organization.
Your comment will be automatically restored once you have accepted the OpenJDK Terms of Use.
|
@slowhog 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! |
|
Hi @mlchung, thanks for making a comment in an OpenJDK project! All comments and discussions in the OpenJDK Community must be made available under the OpenJDK Terms of Use. If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please Use "Add GitHub user mlchung" for the summary. If you are not an OpenJDK Author, Committer or Reviewer, simply check the box below to accept the OpenJDK Terms of Use for your comments.
Your comment will be automatically restored once you have accepted the OpenJDK Terms of Use. |
|
Good, I like this too. I agree with Mandy on documenting this. Also to avoid developer flapping around trying to figure this out then maybe we need a better err.missing.arg resource when potentiallyGnuOption and the param starts with "--". In otherwise, could be just given a better error message? |
|
I prefer to have a better error message which tell users what to do. Would something like following work? |
AlanBateman
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.
The update looks good, I assume you'll bump the copyright date of the files before integrating.
YaSuenag
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.
It's better, thanks!
|
/integrate |
|
@slowhog This pull request has not yet been marked as ready for integration. |
|
@YaSuenag Will need you to re-approve the change, thanks. |
|
/integrate |
|
Going to push as commit d6d45c6.
Your commit was automatically rebased without conflicts. |
Improving option value handling to support passing argument value starts with "--".
Before the fix, in following example, --add-modules will be considered as another option for JLink instead of argument value for --add-options.
--add-options --add-modules=jdk.incubator.concurrent
--add-options=--add-modules=jdk.incubator.concurrent
will cause JLink to report
Error: no value given for --add-options
as --add-modules is considered another option for JLink.
After the fix, by using = will ensure the value is properly handled as argument value
--add-options=--add-modules=jdk.incubator.concurrent
Progress
Warning
8303884: jlink --add-options plugin does not allow GNU style options to be providedIssue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22526/head:pull/22526$ git checkout pull/22526Update a local copy of the PR:
$ git checkout pull/22526$ git pull https://git.openjdk.org/jdk.git pull/22526/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22526View PR using the GUI difftool:
$ git pr show -t 22526Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22526.diff
Using Webrev
Link to Webrev Comment