-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8343839: Detect patched modules and abort run-time image link early #22037
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 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 64 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 |
/label add jigsaw |
@jerboaa
|
Webrevs
|
src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java
Outdated
Show resolved
Hide resolved
src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties
Outdated
Show resolved
Hide resolved
|
The parent pull request that this pull request depends on has been closed without being integrated and the target branch of this pull request has been updated as the previous branch was deleted. This means that changes from the parent pull request will start to show up in this pull request. If closing the parent pull request was done in error, it will need to be re-opened and this pull request will need to manually be retargeted again. |
The latest version now uses the approach @mlchung suggested in #22277 (and doesn't depend on a public property any more). Please take another look. The long-term plan would be to not need this at all. If we were to use the |
src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java
Show resolved
Hide resolved
src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties
Outdated
Show resolved
Hide resolved
src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/RuntimeImageLinkException.java
Show resolved
Hide resolved
IMO, I don't think it's worth putting the effort to support that as running jlink on a patched runtime should be very rare corner case. |
Remove RuntimeImageLinkException which is no longer needed.
Thanks for the feedback. I've filed https://bugs.openjdk.org/browse/JDK-8345184 anyway as it might allow us to remove some of the special cases. |
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.
LGTM
@AlanBateman OK with this too? |
Thanks for the review, @mlchung! |
ModuleBootstap is the place to initialize the module system and setup the boot layer. The ModuleBootstrap.patcher() method is there for its buddy SystemModuleFinders, it should not be public. So I suppose what you have is okay but I think we're going to have work on removing this coupling in the future. |
https://bugs.openjdk.org/browse/JDK-8345184 might solve this. If we don't need to special case a patched runtime this all goes away. |
I'll integrate this and have a look at JDK-8345184 as a follow up. |
/integrate |
Going to push as commit 05ee562.
Your commit was automatically rebased without conflicts. |
Please review this fix to how patched modules are being handled when linking from the run-time image. During review of JDK-8311302 it was pointed out that module patching should be detected earlier and the link should get aborted in that case.
This patch implements it, by using
ModuleBootstrap.patcher().hasPatches()
. After this patch module patching is being detected before any archives are being read or the actual linking process starts (contrary to the previous solution).Testing:
Thoughts?
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22037/head:pull/22037
$ git checkout pull/22037
Update a local copy of the PR:
$ git checkout pull/22037
$ git pull https://git.openjdk.org/jdk.git pull/22037/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22037
View PR using the GUI difftool:
$ git pr show -t 22037
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22037.diff
Using Webrev
Link to Webrev Comment