RFR: 8345259: Disallow ALL-MODULE-PATH without explicit --module-path [v3]

Severin Gehwolf sgehwolf at openjdk.org
Mon Dec 9 18:58:15 UTC 2024


> Please review this bug fix for using `jlink` when linking from the run-time image. For regular JDK builds which include the `jmods` folder, that path is automatically added as the `--module-path` when not otherwise specified on the command line. For JDK builds with JEP 493 enabled, the `jmods` folder doesn't exist and the list of module roots needs to be computed from the system modules. However, since `jdk.jlink` isn't allowed to be added to the list of output modules when linking from the run-time image, the default module path doesn't include `jdk.jlink` and modules depending on `jdk.jlink`, currently only `jdk.jpackage`. This seems a sensible default since otherwise linking using ALL-MODULE-PATH fails, while it works with a JDK build including JMODs. See the bug for details about the issue.
> 
> 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 same. Thoughts?
> 
> Testing:
> - [x] GHA, `test/jdk/tools/jlink` (all pass)
> - [x] Added jlink test.

Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits:

 - 8345259: Disallow ALL-MODULE-PATH without explicit --module-path
 - Merge branch 'jdk-8345573-runtime-link-limit-mods' into jdk-8345259-all-module-path-fix
 - Revert "8345573: Module dependencies not resolved from run-time image when --limit-module is being used"
   
   This reverts commit 95419d9ed41965760ab009b95101b493f338f29b.
 - Revert "8345259: Disallow ALL-MODULE-PATH without explicit --module-path"
   
   This reverts commit 99d4195812c9f5df580464fd908e1eb3f2bfb8cb.
 - Merge branch 'master' into jdk-8345259-all-module-path-fix
 - 8345259: Disallow ALL-MODULE-PATH without explicit --module-path
 - 8345573: Module dependencies not resolved from run-time image when --limit-module is being used
 - Revert "8345259: When linking from the run-time image ALL-MODULE-PATH is not accepted"
   
   This reverts commit 93c2392b0a8ca528a8aafe16e2cca888cb4df8e6.
 - Remove runtimeImage specific test
 - Merge branch 'master' into jdk-8345259-all-module-path-fix
 - ... and 1 more: https://git.openjdk.org/jdk/compare/383d0685...15116a67

-------------

Changes: https://git.openjdk.org/jdk/pull/22494/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22494&range=02
  Stats: 186 lines in 3 files changed: 176 ins; 8 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/22494.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22494/head:pull/22494

PR: https://git.openjdk.org/jdk/pull/22494


More information about the core-libs-dev mailing list