[foreign-memaccess+abi] RFR: 8310659: The jar tool should support allowing access to restricted methods from executable jars [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Jun 27 23:21:18 UTC 2023


On Tue, 27 Jun 2023 20:37:56 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> > do we want to allow module names for modules outside of the executable jar file? i.e. should it just be a supplement to the --enable-native-access command line option?
> 
> After thinking about this for a bit, I think we should allow multiple module names. Consider for instance an executable jar which depends on a library, inside another modular jar file. The library jar is put on the module path, the executable jar passed to `-jar`. I think there should be a way in this case in the jar manifest to enable native access for the library if it needs it. If we just allow `EnableNativeAccess: ALL-UNNAMED` than that doesn't seem possible?

The intent in my previous comment was to only allow ALL-UNNAMED as possible value. I believe this is consistent with the Add-Opens attribute which also targets the unnamed module:

> A `<module>/<package>` pair in the value of an Add-Opens attribute has the same meaning as the command-line option `--add-opens <module>/<package>=ALL-UNNAMED`.

So, there is a strong precedent here for the attribute in the manifest of a jar **not** to affect other modules. If other modules are present, a command line option needs to be added too.

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

PR Review Comment: https://git.openjdk.org/panama-foreign/pull/843#discussion_r1244469398


More information about the panama-dev mailing list