Skip to content

Conversation

@loicottet
Copy link
Member

@loicottet loicottet commented Sep 3, 2024

The goal of this PR is to enable the 23.0 version of GraalVM to correctly parse reachability metadata files emitted by GraalVM 24.1 and future releases. These files are parsed and matched to the existing capabilities of GraalVM 23.0 on a best effort basis, meaning that existing workflows won't be disrupted, but features introduced in subsequent versions will be ignored. For example, GraalVM 24.1 can register members (methods, fields and constructors) of proxy classes for reflection, which was not possible before, and does it via the reflection metadata instead of a separate proxy metadata file. When encountering such metadata, the 23.0 parser will now correctly register the proxy class for runtime instantiation, but won't enable reflective access to the specified members.
The PR is split in two commits to facilitate reviewing. The first one is a simple copy-paste of the parser from master (most of the contents of the com.oracle.svm.core.configure package) and the second contains the modifications required to make the parser fit with the features of 23.0.

To test the new reachability metadata, you can run the native-image-configure tool on the master branch as follows:

${GRAALVM_HOME}/bin/native-image-configure --input-dir=<old-configuration-dir> --output-dir=<new-configuration-dir>

It will output a reachability-metadata.json file which can be used to test parsing the new file format. We're aware of and currently fixing an issue where conditions are incorrectly processed by the tool in some cases, causing parsing errors when trying to read the resulting file. In the mean time, you can use sed -i -e 's/typeReachable/typeReached/g' /path/to/reachability-metadata.json to get the correct behavior.

@loicottet loicottet self-assigned this Sep 3, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 3, 2024
@graalvmbot graalvmbot closed this Sep 3, 2024
@graalvmbot graalvmbot deleted the lottet/backport-metadata-17 branch September 3, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants