Skip to content

[GR-49729] [Espresso] Support running without native access. #10239

Open
@gilles-duboscq

Description

Feature request

Is your feature request related to a problem? Please describe.
Espresso requires native access to run the JDK's native libraries. Native access is also requires due to the implementation of Unsafe.
As a result, to run espresso in a polyglot context it requires all access.

Describe the solution you'd like.
Some of the JDK's native methods could be implemented without having to call native code.
Unsafe can be virtualized in a way that it doesn't require native access.

Describe who do you think will benefit the most.
Users who want to run espresso in a polyglot context without having to enable all access or native access.

Describe alternatives you've considered.

  • The security manager can be used to impose some restrictions in the espresso context but it is being removed.
  • Sulong can be used to run the JDK's native code but that still requires native access in order to call into system libraries. It is also not always straightforward to produce bitcode for the JDK for all platforms.

Additional context.
The I/O part of the JDK would be taken care of by #4625.
The following JDK 21 modules contain native code and are relevant for espresso:

  • java.base
  • java.desktop
  • java.management
  • java.rmi
  • java.security.jgss (kerberos)
  • jdk.jdi
  • jdk.management

java.desktop is too vast to realistically be implemented without calling into the native code.

The following JDK 21 modules contain native code but are unlikely to be used in a no-native espresso context:

  • java.smartcardio (ISO/IEC 7816 smart cards)
  • jdk.crypto.cryptoki (PKCS#11 tokens)

The following JDK 21 modules contain native code but are not relevant for espresso:

  • jdk.hotspot.agent
  • jdk.jdwp.agent
  • jdk.jpackage

Express whether you'd like to help contributing this feature
If you'd like to contribute, please read the contribution guide.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions