-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8345259: Disallow ALL-MODULE-PATH without explicit --module-path #22494
Conversation
👋 Welcome back sgehwolf! A progress list of the required criteria for merging this PR into |
@jerboaa 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 |
Webrevs
|
I'm in two minds as to whether we should do anything here. ALL-MODULE-PATH means all observable modules on the module path but here, it's all observable modules minus jdk.jlink or any module that directly requires jdk.jlink. This is hard to reason about, and not exactly right either because any filtering should be any module that transitively requires jdk.jlink. As background, the original motivation for ALL-MODULE-PATH was Maven build. It has always been supported by jlink too but I can't recall, or find, why we did that. Maybe Mandy can remember. In JEP 261, it is listed as being valid for both compile-time and run-time, but also mentions link-time. |
So am I. The main motivation is that this no longer works with JEP 493 is enabled (no
Without looking at the implementation, the user doesn't add anything explicit via
I'll add here that the reason we need to do this in this patch is because I'd be fine with adding a |
I have the same comment. ALL-MODULE-PATH means all observable modules on the module path that includes
I don't recall neither. It might just be implemented as consistent with java and javac. |
That makes sense. As long as we handle it, I'm fine. So my thinking then is:
Does that sound OK to you? |
Sounds good to me. If |
Just to double check, with the default build, then |
Originally I hadn't intended to do that, but I can add this. Should I do it in this bug or a separate one? I would think that this change of behaviour would need a CSR? |
…limit-module is being used
I think this case was missed when jlink was modified to default the module path to $JDK_HOME/jmods. I think my preference would be for this case to fail when --module-path is not specified. Let's see if Mandy agrees. If we do this change then it would be a behavior change so would need a CSR. |
Such behavioral change is a good change as jlink from the default and --generate-linkable-runtime build would have the consistent behavior. If a module path is given with no root module (empty path), it throws the following error. I think it can throw a similar message as if
|
OK. I'll update the PR accordingly. |
… is not accepted" This reverts commit 93c2392.
…limit-module is being used
This creates an image with jdk.net and its transitive dependences which is the existing behavior, right? We are trying to revisit
Yes. That's how it is implemented as https://openjdk.org/jeps/261#Limiting-the-observable-modules describes:
So jlink sets up the finder that limits the observability and compute the module graph from the roots using this finder. |
Only if the
vs.
I can revert those changes if you prefer. |
I think it helps to think of This leads Note that we have issues at run-time with this combination, and at run-time there are other possible tokens that can be used too. Not for here, this issue has always existed. |
Never mind. That's what JDK-8345573 changed. I've reverted the eager configuration checking. |
Now I see better from JDK 23 implementation.
|
The solution is simpler -- it can just detect if |
That seems like a good suggestion to remove the complexity and need to think what it means. It would avoid complexity in the other phases too. |
The latest update disallows |
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. Please update the copyright end year.
Thanks for the review! Done in the latest update. |
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. This PR uncovers unanticipated issues and thanks for looking at them thoroughly.
Thanks for the thorough reviews as well! |
@AlanBateman OK for you too? Thanks! |
So --limit-modules && --add-modules ALL-MODULE-PATH is an error, as is --add-modules ALL-MODULE-PATH without specifying --module-path. Happy with that. I don't have time to go through the test but Mandy has already reviewed so I think we are good. I'm just wondering if this needs a CSR and also whether the man page needs update. |
Thanks. This has got a CSR. |
/integrate |
Going to push as commit bcb1bda.
Your commit was automatically rebased without conflicts. |
If you think that's needed then I'm fine to follow up with it. I don't think that's warranted. There will be a release note. |
The man page does not mention about
|
Please review this extension to #22609 which now disallows
ALL-MODULE-PATH
without explicit--module-path
option or a non-existent module path. In addition, this fixes a bug mentioned in #22609 whenALL-MODULE-PATH
and--limit-modules
are used in combination. It failed earlier and passes now due to alignment ofModuleFinder
s. With this patch JEP 493 enabled builds and regular JDK builds behave the same in terms ofALL-MODULE-PATH
.When an explicit module path is being added, there is no difference. All modules on that path will be added as roots. Tests have been added for the various cases and existing tests updated to allow for them to run on JEP 493 enabled builds. Thoughts?
Testing:
test/jdk/tools/jlink
(all pass)Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22494/head:pull/22494
$ git checkout pull/22494
Update a local copy of the PR:
$ git checkout pull/22494
$ git pull https://git.openjdk.org/jdk.git pull/22494/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22494
View PR using the GUI difftool:
$ git pr show -t 22494
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22494.diff
Using Webrev
Link to Webrev Comment