Skip to content

[GR-57814] Prevent emission of typeReachable in reachability-metadata.json #9664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from

Conversation

graalvmbot
Copy link
Collaborator

This PR contains bugfixes to the native-image-configure tool, to make sure it outputs correct metadata when converting *-config.json files using the old format into the new reachability-metadata.json. The fixes are in separate commits and are as follows:

  • Make the agent and configure tool consider typeReachable conditions as typeReached. This is necessary to ensure no duplication during configuration merging, but is undesirable in the builder, who needs to maintain this distinction to avoid breaking existing workflows;
  • Make the agent and configure tool output only typeReachable conditions in *-config.json files and typeReached conditions in reachability-metadata.json. This is linked to the previous fix and necessary when the tools have to fallback to emitting *-config.json files due to elements being unsupported in the new format;
  • Fix the parsing of resource bundles and globs to accept the right type of condition based on the file being parsed and make the configuration parser consider resource patterns of the form \Qsimple/path/without/special/characters\E as globs. The latter part is not strictly needed but helps as a mitigation of the previously mentioned issues by limiting the amount of resource patterns being emitted, since those are deprecated and not accepted in reachability-metadata.json;
  • Make ParserConfigurationAdapter accept alwaysTrue when registering elements of an existing type. This is necessary to avoid making the parser aware of whether it is run on the builder or the agent/configure tool. Otherwise we would need to conditionally register reflective elements (methods, fields, etc.) when parsing a "type" metadata entry in the builder only.
  • Fix the output of ProxyConfiguration and ResourceConfiguration to rely on JsonPrettyPrinter for formatting, like what is done for reachability-metadata.json. This is a cosmetic change but should be backported alongside the fixes in this PR to ensure consistent output from the release of the new metadata format.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 11, 2024
@graalvmbot graalvmbot closed this Sep 17, 2024
@graalvmbot graalvmbot deleted the lottet/GR-57814-configure-type-reachable branch September 17, 2024 02:50
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
None yet
Development

Successfully merging this pull request may close these issues.

2 participants