On Mon, 20 Apr 2026 08:46:55 GMT, Severin Gehwolf <[email protected]> wrote:

>> David is working on an "end to end" test that will run jlink to create a 
>> run-time image that contains classes compiled with preview features enabled 
>> in META-INF/preview. Running a test with the resulting run-time image, both 
>> with preview features enabled and disabled, will ensure that it works as 
>> expected. It will need to be run with the default config, and builds that 
>> were configured with `--enable-linkable-runtime` of course.
>> 
>> But maybe your question is more about running the jlink tool itself with 
>> preview features enabled? I suspect `jlink -J--enable-preview` would be 
>> rare, but executing it with ToolProvider (and thus in-process) is important 
>> to test too.
>
> The concern here is that running `jlink` on a JEP 493 enabled JDK (no jmods) 
> and on a JDK *with* JMODs give you the exact same custom runtime image. I.e. 
> it has to include both preview and non-preview versions if both are present 
> for a class. There is a test, 
> `test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java`
>  which tries to assert that.

> David is working on an "end to end" test that will run jlink to create a 
> run-time image that contains classes compiled with preview features enabled 
> in META-INF/preview. Running a test with the resulting run-time image, both 
> with preview features enabled and disabled, will ensure that it works as 
> expected. It will need to be run with the default config, and builds that 
> were configured with `--enable-linkable-runtime` of course.

That's good. Thanks!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29414#discussion_r3109483302

Reply via email to