Skip to content

Initialize NativeDetector at build time #28244

Closed
@sdeleuze

Description

@sdeleuze

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.

Metadata

Metadata

Assignees

Labels

theme: aotAn issue related to Ahead-of-time processingtype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions