Skip to content

Fix imperative Helidon native image build and startup - #351

Merged
mraible merged 1 commit into
mainfrom
fix-imperative-helidon-native
Oct 27, 2026
Merged

mraible merged 1 commit into
mainfrom
fix-imperative-helidon-native

Conversation

@mraible

@mraible mraible commented Oct 27, 2026

Copy link
Copy Markdown
Owner

The Build and Publish Imperative Images workflow has failed on every push to main since August 10, at the Helidon native build. Because Helidon builds first, the Micronaut, Quarkus, and Spring Boot imperative images haven't been published since then either.

Two separate problems were in the way:

  • Static build: GraalVM 25 rejects --static unless it uses musl libc. Helidon's own template uses GraalVM 21, where the static glibc build fails to link with undefined reference to `__xmknod'. This is Building Dockerfile.native fails helidon-io/helidon#10767. I applied the second workaround a Helidon maintainer recommends there: drop -Dnative.image.buildStatic and run on oraclelinux:9-slim instead of scratch. The first workaround (musl) only works on x86, and the reporter hit runtime errors with it.
  • Startup crash: The native app then exited with NoSuchMethodException: RoleAnnotationAnalyzer.init(io.helidon.common.config.Config). Since 4.4, Helidon's AnnotationAnalyzer uses DeprecationSupport.isOverridden() to check by reflection whether an analyzer overrides a deprecated init method, and the native image has no reflection metadata for it. The same crash happens with GraalVM 21. A new reflect-config.json registers public methods for both annotation analyzers on the classpath.

I built the Docker image locally with Dockerfile.native on arm64. The app started in 23 ms, returned 401 for /hello without a token, and returned 200 for /health. The image is 218 MB, up from a static binary on scratch.

The publish workflow has failed at the Helidon native build since August. GraalVM 25 only allows --static with musl libc, and GraalVM 21's static glibc build fails to link. This applies the workaround a Helidon maintainer recommends in helidon-io/helidon#10767: build a regular dynamically linked binary and run it on oraclelinux:9-slim instead of scratch.

The native app also crashed on startup with NoSuchMethodException for RoleAnnotationAnalyzer.init. Since 4.4, Helidon checks by reflection whether an annotation analyzer overrides a deprecated init method, and the native image had no reflection metadata for that lookup. reflect-config.json now registers public methods for both annotation analyzers on the classpath.
@mraible
mraible merged commit 6cf5d1a into main Oct 27, 2026
13 checks passed
@mraible
mraible deleted the fix-imperative-helidon-native branch October 27, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant