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

Severin Gehwolf sgehwolf at openjdk.org
Mon Jun 3 10:12:16 UTC 2024


On Sun, 2 Jun 2024 17:41:55 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> I've been looking through the changes. One thing that I'm wondering about is whether --generate-runtime-link-image should disable the keeping of packaged modules (set JLINK_KEEP_PACKAGED_MODULES to false). It seems surprising to use this configure option and have the jlink command in the build also copy the packaged modules into the image.

@AlanBateman IMO those are orthogonal concepts. Note that the configure options are `--enable-packaged-modules` and `--enable-runtime-link-image`. The corresponding `jlink` options are `--keep-packaged-modules` and `--generate-linkable-runtime`. My mental model is that with this patch it allows a more flexible distribution of the JDK build. The testing story also seems easier in its current form. All non-linkable runtime tests run as-is - with a linkable runtime build - but also run linkable runtime tests (those have appropriate `@requires` tags). We've had some discussion around this already in this review thread. I'm arguing that both configure options make sense independently and in combination. The user can configure it to their liking. What I'd try to avoid is needing to produce two different builds whether or not the JDK is runtime linkable or not. That is because our prime use-case is to make `jmods` optional when `jlink` is being used post build and test.

I've tried to explain it earlier [here](https://github.com/openjdk/jdk/pull/14787#issuecomment-1999307995) and [here](https://github.com/openjdk/jdk/pull/14787#issuecomment-2003848668). @mlchung seemed OK with it [here](https://github.com/openjdk/jdk/pull/14787#issuecomment-2004605507) and @erikj79 was ok with it as well [here](https://github.com/openjdk/jdk/pull/14787#issuecomment-2004761747).

Is there a specific reason this needs to be done? With the current patch `--enable-runtime-link-image` influences how the `jimage` in `lib/modules` looks like (adds some metadata) nothing else. `--enable-packaged-modules` influences copying of the packaged modules.

Right now, what you are suggesting could be achieved with these configure options:
`--enable-runtime-link-image --disable-packaged-modules`

Is that not sufficient?

Thoughts?

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

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


More information about the build-dev mailing list