generated from micronaut-projects/micronaut-project-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit updates how Micronaut AOT generates code for GraalVM 22. In 22, the new default is to forbid build time initialization of classes. Each class which is initialized at build time has to be explicitly declared as such. This commit makes it so that classes we generate and know are initialized at build time are added to the `--initialize-at-build-time` option. While this fixes a lot of cases, we cannot, unfortunately, kwow upfront all the dependencies of the types we initialize at build time, which may _also_ need build time initialization. This means that in some cases, users will have to explicitly add some types to the list (e.g via a `buildArg` in the native binaries Gradle extension). Ideally, we should move AOT off build time initialization. However, this is not currently doable, since precisely Micronaut Core and optimization registration is designed to use static fields. An option would be to use service loading instead, but it's a breaking change, and that would remove the ability to have a service loading optimization. While removing the service loading optimization may not be an issue for native, it is, however, a problem for JIT optimizations. There's therefore no good solution that I'm aware of to this problem.
- Loading branch information
Showing
9 changed files
with
121 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters