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

Initialize NativeDetector at build time #28244

Closed
sdeleuze opened this issue Mar 29, 2022 · 0 comments
Closed

Initialize NativeDetector at build time #28244

sdeleuze opened this issue Mar 29, 2022 · 0 comments
Assignees
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@sdeleuze
Copy link
Contributor

In order to allow code removal with constructs like if (NativeDetector.inNativeImage()) { ... } else { ... }, NativeDetector needs to be initialized at build time. -H:+InlineBeforeAnalysis is enabled by default as of GraalVM 21.3 so no further configuration is needed.

Since build time initialization is not necessarily something we want to expose in public APIs, embedding a spring-core/src/main/resources/META-INF/native-image/org.springframework/spring-core/native-image.properties file for that purpose is the solution chosen for now.

@sdeleuze sdeleuze added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Mar 29, 2022
@sdeleuze sdeleuze added this to the 6.0.0-M4 milestone Mar 29, 2022
@sdeleuze sdeleuze self-assigned this Mar 29, 2022
sdeleuze added a commit to sdeleuze/spring-framework-native-samples that referenced this issue Mar 29, 2022
sdeleuze added a commit to sdeleuze/spring-framework-native-samples that referenced this issue Mar 29, 2022
snicoll pushed a commit to snicoll/spring-framework-native-samples that referenced this issue Mar 29, 2022
nikoladic pushed a commit to nikoladic/spring-framework-native-samples that referenced this issue Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant