RFR: 8344560: Add system property for patched runtime

Severin Gehwolf sgehwolf at openjdk.org
Thu Nov 21 10:41:14 UTC 2024


On Thu, 21 Nov 2024 07:46:46 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> > Having now looked at #22037 which is what motivated this change, I now have a more basic question.
> > The `--patch-module` option is an option for the `java` command. The code changes in this current PR is proposing to set a system property if `java` was launched with `--patch-module=...`. The other PR is about image creation using `jlink` command. Looking at the other PR, it proposes to look for the presence of this system property to do some decisions during image creation. However, when that `jlink` command is invoked, it's a completely different process/runtime, so how would `--patch-module` for `java` setting a system property propagate to that image creation `jlink` process?
> > I am feeling that I have misunderstood what's being proposed here.
> 
> This is the corner case of jlink being run with -J--patch-module or "in-process" with ToolProvider.

Correct. For example, during testing of the implementation of JEP 493, a failure was observed in a completely unrelated langtools test, `test/langtools/tools/javac/plugin/AutostartPlugins.java` with a linkable runtime build. That test uses `jlink` via `ToolProvider` and wasn't being run with `/othervm`. At the same time, jtreg itself patches the test JDK runtime with `JTRegModuleHelper`.

> I see Severin recently added to the link of restrictions in JEP 493 but I'm not sure that it rises to the level that it should be mentioned in the JEP.

Happy to remove it from the JEP, but I don't think it does any harm. Does it?

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

PR Comment: https://git.openjdk.org/jdk/pull/22277#issuecomment-2490753599
PR Comment: https://git.openjdk.org/jdk/pull/22277#issuecomment-2490755637


More information about the core-libs-dev mailing list