On Fri, 1 Nov 2024 18:03:16 GMT, Mandy Chung <mch...@openjdk.org> wrote:

> I expect that the jmodless tests will first build an image (say `image1`) 
> using jlink `--generate-linkable-runtime` option and then verify 
> `image1/bin/jlink` that links from the run-time image. I don't see 
> `--generate-linkable-runtime` option is used from jmodless tests. I looked at 
> `AbstractLinkableRuntimeTest` which provides the support to create linkable 
> runtime image but not obvious to me. Can you describe the idea of this test 
> framework?

This has gone through a couple of iterations. The idea once was, as you 
describe now, to create a run-time image link capable JDK on the fly for 
testing. Then, once the build flag got introduced it changed to it assuming a 
run-time image link capable JDK (and only removed `jmods` if present - to 
provoke run-time image based linking) and tests would only activate on such 
builds.

> OK. I see this now (`@requires jlink.runtime.linkable` in all jmodless 
> tests). I.e. No test for the default JDK build.

Correct. Though, I've been testing builds using `--enable-linkable-runtime` in 
GHA here for example (Linked in the description of the PR): 
https://github.com/jerboaa/jdk/actions/runs/11612287720
 
> I think this feature needs test verification even for the default JDK build. 
> One way to do that is to build a test image (say `base-image`) using jlink 
> `--generate-linkable-runtime` option and then verify `base-image/bin/jlink` 
> instead of the JDK.

That makes sense. The framework mostly supported this use-case anyway so I've 
now extended it to run those tests also on the default build (`jlink` with 
`-run-time-image` capability). Those now do perform an extra step to create a 
JDK with the capability first. If the JDK build has the capability already 
turned on, this step is omitted.

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

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

Reply via email to