Skip to content
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

[GR-27173] Automatic conditional configuration generation. #4270

Merged
merged 7 commits into from
Mar 11, 2022

Conversation

graalvmbot
Copy link
Collaborator

This PR implements automatic conditional config generation in the agent.

Usage

To enable this feature, pass the experimental-conditional-configuration=<package-prefixes> option to the native-image agent. The <package-prefixes> parameter is a comma separated list of packages - classes from these packages will be used to generate conditions.

Only while using this mode, a special agent option class-name-filter=<regex-list> is available. This option accepts a comma separated list of regex patterns - classes in both the configuration condition and, where applicable, the configuration itself will be removed from the final configuration.

Implementation

This implementation leans on the configuration with origins tracing to generate a call graph where origins of each configuration entry are known. Using this information, the config is generated in the following steps:

  1. For each unique method in the call graph, generate a list of nodes, one node for each call of that method. Assign an initial configuration set to that node, or an empty set if no configuration was traced in that call.
  2. For each list of nodes, iterate and find the common configuration between the nodes in that list.
  3. For each node in said list, keep the common configuration and propagate the node specific configuration to the caller node.
  4. Repeat steps 2. and 3. while there are still changes in any of the node lists.

@graalvmbot graalvmbot force-pushed the gradinac/GR-27173/agent-conditional-config branch from 4f8e610 to 0089306 Compare February 4, 2022 15:47
@graalvmbot graalvmbot force-pushed the gradinac/GR-27173/agent-conditional-config branch from 476fd38 to 4c208b1 Compare February 18, 2022 12:56
@graalvmbot graalvmbot force-pushed the gradinac/GR-27173/agent-conditional-config branch 4 times, most recently from ab0744a to 0d6008d Compare March 4, 2022 01:16
@graalvmbot graalvmbot force-pushed the gradinac/GR-27173/agent-conditional-config branch 5 times, most recently from 8af1f62 to f4a7c2a Compare March 10, 2022 14:37
@graalvmbot graalvmbot force-pushed the gradinac/GR-27173/agent-conditional-config branch from f4a7c2a to e40f3f8 Compare March 10, 2022 17:17
@graalvmbot graalvmbot merged commit 6bb3cd3 into master Mar 11, 2022
@graalvmbot graalvmbot deleted the gradinac/GR-27173/agent-conditional-config branch March 11, 2022 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants