RFR: 8327218: Add an ability to specify modules which should have native access enabled [v2]

Jan Lahoda jlahoda at openjdk.org
Wed Mar 6 15:01:47 UTC 2024


On Tue, 5 Mar 2024 13:58:50 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Apply suggestions from code review
>>   
>>   Co-authored-by: ExE Boss <3889017+ExE-Boss at users.noreply.github.com>
>>   Co-authored-by: Maurizio Cimadamore <54672762+mcimadamore at users.noreply.github.com>
>
> src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java line 817:
> 
>> 815:                 JLA.addEnableNativeAccessToAllUnnamed();
>> 816:             } else if (!JLA.addEnableNativeAccess(layer, name) && shouldWarn) {
>> 817:                 warnUnknownModule(ENABLE_NATIVE_ACCESS, name);
> 
> Should we instead warn irrespective of whether or not it's user configured native access module name or a module name configured in JDK's build configuration? Or are the build misconfiguration in the `NATIVE_ACCESS_MODULES` expected to be caught much earlier in some other place?

For normal "full" JDK build, all the modules with pre-set native access should be present, and the warning might make sense there. But, the user may jlink a smaller version of the platform, or use `--limit-modules`, and that may cause some of the modules are not present. So I don't think it is realistic to produce a warning here for the modules with pre-set native access.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18106#discussion_r1514633918


More information about the build-dev mailing list