Skip to content

Resource reachability or do not optimize flag #9479

Answered by wirthi
BLCK-B asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

you are not providing any configuration for the ahead-of-time compilation. Native-Image needs to understand what e.g. resources you want to have included.

The tracing agent can provide that information based on a test run that covers the relevant usecases:
https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/
The output won't be perfect and will certainly need manual tuning.

I got that working by adding this to the build.gradle:

bootRun {
    jvmArgs("-agentlib:native-image-agent=config-output-dir=tracing")
}

The content of the tracing dir I then copied to build/resources/aot/META-INF/native-image - there is probably a better way to do thi…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@BLCK-B
Comment options

@wirthi
Comment options

wirthi Aug 14, 2024
Collaborator

@BLCK-B
Comment options

Answer selected by BLCK-B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants