RFR: 8343839: Detect patched modules and abort run-time image link early
Alan Bateman
alanb at openjdk.org
Tue Nov 12 14:33:07 UTC 2024
On Tue, 12 Nov 2024 13:51:17 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java line 625:
>>
>>> 623: // Do not permit linking from run-time image when the current image
>>> 624: // is being patched
>>> 625: if (jdk.internal.misc.VM.getSavedProperties().get("jdk.module.patch.0") != null) {
>>
>> I don't think we should introduce this dependency. Instead, I think we should look at adding a property such as jdk.patched, with a boolean value, to indicate if the current runtime is patched or not. This could be useful for java -XshowSettings output too.
>
>> Instead, I think we should look at adding a property such as jdk.patched
>
> You mean a new standard property - observable with `System.getProperty("jdk.patched")` as well - which would also show up with `java -XshowSettings:properties`? Is that the direction you are envisioning?
Yes, I'm wondering if a JDK-specific (rather than standard) property could be more widely useful as it would allow observability tools to know that the JDK has been patched. It would be good to get wider input on this.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22037#discussion_r1838203008
More information about the core-libs-dev
mailing list