feat(native): RuntimeHintsRegistrar for GraalVM Native (planning §14)#10
Merged
Conversation
Adds DevslabKitRuntimeHints + wires it via @ImportRuntimeHints on TenantAutoConfiguration (which is always active). Covers the reflection / resource surface the kit will need under nativeCompile: Reflection — full MemberCategory.values() so Hibernate can introspect constructors, methods, and field access: - PlatformUserAccountEntity - PlatformRoleEntity / PermissionEntity / UserRoleEntity / RolePermissionEntity - PlatformGroupEntity / UserGroupEntity / GroupRoleEntity - PlatformMenuEntity - PlatformAuditLogEntity Reflection — constructor + declared methods so Spring can invoke ApplicationListener payloads: - LoginSucceededEvent / LoginFailedEvent / UserAccountCreatedEvent Resources — pattern matches so the native image bundles them: - db/migration/*.sql (Flyway V1-V6) - META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports What this does NOT do: actually run ./gradlew nativeCompile. That's a 10-20 minute build with non-trivial memory needs and routinely needs another fix-cycle (per-record hints, dynamic proxies). The expectation is that consumer apps run nativeCompile in their own pipeline (sample-app already has `org.graalvm.buildtools.native` plugin from PR #1). When that produces a missing-hint failure, the hint goes into this class. Verified: ./gradlew :devslab-kit-sample-app:test -> BUILD SUCCESSFUL in 58s (hints registration doesn't run at JVM-mode test time, but the ApplicationContext still boots cleanly so the @ImportRuntimeHints wiring at least compiles + loads.)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the GraalVM Native hints registration that planning §14 calls out as a first-class requirement. Does not actually run
nativeCompile— that's deferred to consumer apps' own pipelines (or a tag-only CI job later) because the build is heavy (10–20 min, 8GB+ memory) and routinely needs follow-up fix cycles per missing hint.What's wired
DevslabKitRuntimeHints(new) is loaded via@ImportRuntimeHintsonTenantAutoConfiguration(always active when the kit is on the classpath).Reflection —
MemberCategory.values()Hibernate needs constructor + method + field access:
Platform{UserAccount,Role,Permission,UserRole,RolePermission,Group,UserGroup,GroupRole,Menu,AuditLog}EntityReflection — constructors + methods
ApplicationListener callbacks reflect on accessors:
Login{Succeeded,Failed}Event,UserAccountCreatedEventResources
db/migration/*.sql(Flyway V1–V6 bundled in each-corejar)META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports(defensive)What this does NOT do
./gradlew nativeCompile— see header.sample-appalready has theorg.graalvm.buildtools.nativeplugin from PR chore: multi-module split with base platform contracts #1, so consumers / a follow-up cron can invoke it directly.@ConfigurationProperties— Spring Boot's own AOT processor handles those automatically. We only register what's beyond its reach.When
nativeCompileproduces a "missing reflection" error in the futureAdd the offending class to
DevslabKitRuntimeHintsand ship a patch. That's the maintenance contract.Verified
Hints registration is a no-op at JVM-mode test time, but ApplicationContext still boots cleanly so the
@ImportRuntimeHintswiring at least compiles + loads.