RFR: 8311302: Allow for jlinking a custom runtime without packaged modules being present [v20]

Severin Gehwolf sgehwolf at openjdk.org
Fri Mar 15 09:57:45 UTC 2024


On Thu, 14 Mar 2024 21:16:04 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> About the configure options,
> 
> ```
>   --enable-keep-packaged-modules
>                           enable keeping of packaged modules in jdk image [enabled]
>   --enable-runtime-link-image
>                           enable producing an image suitable for runtime linking [disabled]
> ```
> 
> If `--enable-runtime-link-image` is enabled, the JDK image does not include the packaged modules.

That's not true. Right now `--enable-runtime-link-image` modifies how the `lib/modules` image looks like (adds a bunch of extra resources). That's it. It doesn't modify the setup of packaged modules. Since it doesn't change them, I don't see a reason to not include them in the image. The difference is that if you do `rm -rf images/jdk/jmods` you can still run `jlink` while with a not runtime link enabled image, you cannot. `jmods` become truly optional. Why is that a problem?

> If `--enable-runtime-link-image --enable-keep-packaged-modules` are both enabled, it should probably fail? @erikj79 should it?

It seems orthogonal to me whether or not packaged modules are enabled or not. If they are indeed there, the regular jlink happens based on packaged modules (without specifying a module path) as happens today. When there is no module path that includes `java.base`, and we have a runtime enabled image. The runtime image based link is performed.

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

PR Comment: https://git.openjdk.org/jdk/pull/14787#issuecomment-1999307995


More information about the build-dev mailing list