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

Native image support #464

Closed
wants to merge 6 commits into from

Conversation

timmattison
Copy link

This addresses issue #311.

I have added support for native image that has been tested with GraalVM 22.0.0.2 on Java 17.

The final commit on this PR builds a native image application to print out the operating system name from CRT. This application will build but fail to run without the added configuration. With the new configuration files added it runs as expected.

This has not been tested with every CRT feature so some testing needs to be done to see if the configuration files are complete.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Needed to remove the version number from smithy-crt/build.gradle.kts since it inherits the version from the parent
…mage works

This should not be included if the PR is accepted. This should probably be moved into a test of some kind to track if it breaks at any point.
@timmattison timmattison mentioned this pull request Apr 27, 2022
@maschnetwork
Copy link
Contributor

maschnetwork commented Jun 21, 2022

@timmattison this is great - it helped me a lot getting it running. In the meantime there were some new classes added so I had to fix the jni-config. I can confirm this is working for a sample application that writes items to DynamoDB. You can find the full version with the latest CRT Client version here: https://github.com/maschnetwork/aws-lambda-graalvm-crt

Here you can find the updated jni-config and the resource-config which only includes the linux client.

To be able to get the new jni-config I had to do the following things:

  1. Clone this repo
  2. Install dependencies (cmake) & GraalVM
  3. Add an App.class that you provided to be able to execute the native image command
  4. Run maven clean package -DskipTests=true to get the uber-jar
  5. Run java -agentlib:native-image-agent=config-output-dir=./graal-output -cp target/aws-crt-1.0.0-SNAPSHOT.jar software.amazon.awssdk.crt.App to get the new configs
  6. Merge some additional configuration from this PR (e.g. ByteBuffer)

@yasminetalby yasminetalby added the pr/needs-review This PR needs a review from a Member. label Jun 26, 2023
@jmklix jmklix closed this May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/needs-review This PR needs a review from a Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants