RFR: 8311302: Allow for jlinking a custom runtime without packaged modules being present [v20]
Severin Gehwolf
sgehwolf at openjdk.org
Mon Mar 18 13:03:34 UTC 2024
On Fri, 15 Mar 2024 19:29:49 GMT, Mandy Chung <mchung at openjdk.org> wrote:
> > > 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.
>
> It is true that they are orthogonal. jlink does allow to produce a linkable image with `--keep-packaged-modules` and the resulting JDK image would work.
More so, the compatibility to the status quo would be better (in terms of produced build output).
> However, the goal of this work is to produce a JDK image with smaller footprint. This is a question to JDK build to allow configuring building a linkable image with packaged modules.
IMO something like that could be achieved by creating a separate bundle (take the JDK image, but don't include the packaged modules, for example).
> In addition, `--enable-keep-packaged-modules` is enabled by default. Do you want the linkable image includes `jmods` as it's currently implemented in this PR?
Yes we do. The main reason being that the `jdk` image has more to it than just the image. `src.zip`, CDS data, `demo` and so on. We don't want to duplicate that. To us, including the `jmods` folder is something that comes into play when actually producing the bundles of the JDK. The linkable runtime option allows for a more flexible distribution of the resulting JDK. With or without packaged modules without limiting `jlink` usage (for the common use-cases).
If somebody truly wanted to *not* have the packaged modules after a build with a runtime-linkable-image that's possible with the following configure options: `--enable-linkable-runtime-image --disable-keep-packaged-modules`.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14787#issuecomment-2003848668
More information about the build-dev
mailing list