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

Add JNI config for native image #153

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Conversation

luneo7
Copy link
Contributor

@luneo7 luneo7 commented Oct 10, 2024

Adds JNI config for native image, with that we are able to use the lib and compile to native image with GraalVM.
The META-INF native-image folder/files follows the docs. All the classes accessed through JNI needs to be there, and methods as well, all existing methods are supported in native image with this new jni-config.json file added.

Fixes #55

@luneo7
Copy link
Contributor Author

luneo7 commented Oct 10, 2024

/cc @isaacbrodsky

@luneo7
Copy link
Contributor Author

luneo7 commented Oct 10, 2024

/cc @dfellis

@luneo7
Copy link
Contributor Author

luneo7 commented Oct 10, 2024

Going to add the include resources as well, as we need to include the native libs, just a sec...

@luneo7
Copy link
Contributor Author

luneo7 commented Oct 10, 2024

Added resource configuration as well, now it loads the lib correclty =)

@coveralls
Copy link

coveralls commented Oct 10, 2024

Pull Request Test Coverage Report for Build #435

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.817%

Totals Coverage Status
Change from base Build #432: 0.0%
Covered Lines: 501
Relevant Lines: 507

💛 - Coveralls

@luneo7
Copy link
Contributor Author

luneo7 commented Oct 10, 2024

Native image needs the jni config and the resource config, as it needs to load the lib and without the resource config it wouldn't find the native lib. Thanks @isaacbrodsky @dfellis for the prompt reviews =)

@luneo7
Copy link
Contributor Author

luneo7 commented Oct 10, 2024

@dfellis @isaacbrodsky can you trigger the test again please? it failed pulling a docker image

Copy link
Collaborator

@isaacbrodsky isaacbrodsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could test that this json definition is correct, perhaps by running GraalVM or something that consumes it in CI?

@isaacbrodsky isaacbrodsky merged commit 0c4f071 into uber:master Oct 11, 2024
83 checks passed
@luneo7
Copy link
Contributor Author

luneo7 commented Oct 15, 2024

@isaacbrodsky I will open a PR with native image tests, and hopefully you can do a release after validating that native and everything is working? (found out that we need to tweak the resources file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compatibility with graalvm native-image
4 participants