Hi, just a concern that brings me to this matter. Spring Boot has several internal processes that helps and speed up development. I was configuring an existing application, which uses latest Spring Boot version (3.3.0) with all latest dependencies, to compile natively. After change pom.xml adding GraalVM plugin and all other native image configuration there are some classes, objects or types which needs be set manually by implementing RuntimeHintsRegistrar and it needs to be done for each object/type.
Considering that each native image takes up to 10 minutes to generate we figure out these gaps when we try to run application, it means that each 10 minutes building we could figure out a new change that needs RuntimeHintsRegistrar implementation and also might occurs that new changes be forgotten which would cause a new defect. Also FeingClients also needs be explicitly informed as well as RuntimeHintsRegistrar classes with annotations on a @Configuration class as follows:
@ImportRuntimeHints(value = {MyRuntimeHint.class,
MyRuntimeHint2.class})
@LoadBalancerClients({@LoadBalancerClient(value = "feing-client-1", name = "feing-client-1"),
@LoadBalancerClient(value = "feing-client-2", name = "feing-client-2"),
@LoadBalancerClient(value = "feing-client-3", name = "feing-client-3")})
Thats the one of the reasons that I am not that confident do use Spring Boot + GraalVM despite to want to by considering that Spring offer us several production-ready abstraction layers that makes developers and architects happy to use it :).
Maybe, at compiling/building time, Spring tries to start itself and creating missing AOT objects dynamically, I don't know.
Do you have any scheduled proposal to have it created dynamically without much development effort when a native image?
Thank you.
Comment From: wilkinsona
Unfortunately, longer build times are the nature of the beast with GraalVM when creating a native image. There are plans to allow the Graal JVM to be run in a mode that will report missing runtime hints without the overhead of building a native image. This'll be a significant improvement but it's one that's out of our control.
In the meantime, the need for a runtime hints registrar should be pretty rare. If you need hints to use Spring Cloud OpenFeign, please open an issue over there as I believe it should work without them.
Beyond this, without more specifics, there's not much that we can do here. It may be that there are other bugs in Spring projects, it may be that there is missing reachability metadata, or it may be that your application itself is performing reflection and you'll have to tell Graal about it. Can you provide more details about the failures that you've encountered?
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.