-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Rename reflection-config.json into reflect-config.json and resources-config.json into resource-config.json #38118
Conversation
…config.json into resource-config.json
🙈 The PR is closed and the preview is expired. |
-H:ResourceConfigurationFiles=resources-config.json,\ | ||
-H:ResourceConfigurationFiles=resource-config.json,\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will let @zakkak chime in but do we even need to register the file if we are following the convention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update @dliubars.
Please note that after the renaming of the files, passing ResourceConfigurationFiles
and ReflectionConfigurationFiles
is no longer required.
The generated configuration files can be supplied to the native-image tool by placing them in a META-INF/native-image/ directory on the class path. This directory (or any of its subdirectories) is searched for files with the names jni-config.json, reflect-config.json, proxy-config.json, resource-config.json, predefined-classes-config.json, serialization-config.json which are then automatically included in the build process. Not all of those files must be present. When multiple files with the same name are found, all of them are considered.
If the user/dev wants to place the files in a different directory (i.e. one not containing META-INF/native-image/
in its path or a directory not included in the classpath) then -H:ConfigurationFileDirectories
should be used instead:
A directory containing configuration files that is not part of the class path can be specified to native-image via -H:ConfigurationFileDirectories=/path/to/config-dir/. This directory must directly contain all files: jni-config.json, reflect-config.json, proxy-config.json and resource-config.json. A directory with the same metadata files that is on the class path, but not in META-INF/native-image/, can be provided via -H:ConfigurationResourceRoots=path/to/resources/. Both -H:ConfigurationFileDirectories and -H:ConfigurationResourceRoots can also take a comma-separated list of directories.
Hi @zakkak, thank you for the review!
As I understand it, the documentation suggests placing config files under In my understanding, specifying
As far as I understand, I apologize for any confusion. The intention of this PR was not to alter the proposed configuration method, but rather to use file names consistent with Graal (whether these files are automatically picked up or specified explicitly). I should have provided some context: when I was adapting langchain4j to be ready for use in native, I have used several guides (including this one) and spent some time figuring out why my configuration in Please feel free to modify or reject this PR, or let me know what should be changed. |
Indeed, in this case the extra flags are necessary. Perhaps we should change the docs and ask devs to place the config files under
Correct, but this doesn't prevent us from adding them under a different directory in the
Interesting, we need to fix this in upstream GraalVM documentation, since
I see what you mean, but that's the only non-experimental option I am aware of.
No need for apologies, I totally understand the motivation behind this PR, I am just trying to make sure we provide the best possible instructions to save people from further confusion in the future :)
Note that only 1 is a blocker, 2 and 3 are just my suggestions and are up for discussion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. These changes still promote using experimental flags that produce warning messages. I propose this PR to be closed and instead integrate #38186.
Hi, pardon for the late reply! Sure, feel free to close this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@galderz it looks like @dliubars updated the PR and it now only includes the following changes (i.e. it no longer suggests using experimental options):
- replace references to
resources-config.json
withresource-config.json
- replace references to
reflection-config.json
withreflect-config.json
I suggest you either:
- merge this PR and rebase Update native configuration file best practices #38186
or - cherry-pick @dliubars commit in from this PR in Update native configuration file best practices #38186
Updating config file names to be consistent with those specified here: https://www.graalvm.org/latest/reference-manual/native-image/metadata/