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

Mandy Chung mchung at openjdk.org
Tue Nov 14 17:55:31 UTC 2023


On Tue, 14 Nov 2023 15:58:57 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

> > The current implementation `--system-modules` re-applies for every jlink invocation since the transformation depends on the set of modules to be linked in the resulting image.
> 
> Yes. The same is true for a run-time image based link for the system modules plugin.
>
> > OTOH `--vendor-bug-url`, `--vendor-version` and `--vendor-vm-bug-url` plugins are auto-applied to the new image created via this run-time image based linking when these options are not specified.
> 
> Since some of those things are also possible to specify at build-time (with ` --with-vendor-name` and friends), this applies to the packaged-modules link as well.

Better to explain with an example:


$ jdk22/bin/jlink --add-modules jdk.compiler,jdk.jlink --output image1 --vendor-bug.url https://xyz.com/bugs --save-jlink-argfiles argfile --generate-jli-classes jli_trace.txt --strip-debug --add-options "-Dcom.foo.XYZ=true"

$ image1/bin/jlink --add-modules jdk.jlink --output image2 --add-options "-Dcom.acme.name=BAR"


How can the user know what plugins are applied to `image2`?   i.e. what is the jlink command to produce `image2` if running from `jdk22` with the packaged modules present?

Reading the changes, I'm not sure but I think it's not equivalent to:

jdk22/bin/jlink --add-modules jdk.jlink --output image2 --vendor-bug.url https://xyz.com/bugs --save-jlink-argfiles argfile --generate-jli-classes jli_trace.txt --strip-debug --add-options "-Dcom.foo.XYZ=true" --add-options "-Dcom.acme.name=BAR"


I think this behavior should be documented.

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

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


More information about the core-libs-dev mailing list