Repository navigation
Embed all locales via -H:+IncludeAllLocales - #48
Merged
Merged
Conversation
`-H:IncludeLocales=` with an empty value does not mean "all locales" on GraalVM 21.0.2 (or current master): the empty string is parsed as a single language tag, and only `-H:+IncludeAllLocales` adds every available locale. The resulting image is the same as one built with no locale flag at all, so the Linux release binaries still abort in protobuf-java's `RuntimeVersion.<clinit>` with: MissingReflectionRegistrationError: sun.text.resources.cldr.FormatData_en_US Reproduced with protoc-gen-markdown (same protobuf-java path and flags) built in a GraalVM CE 21.0.2 Linux container with LANG=C.UTF-8, matching the GitHub runners: no flag and `-H:IncludeLocales=` both crash under every runtime locale tested; `-H:+IncludeAllLocales` starts cleanly under C.UTF-8, en_US, de_DE, ja_JP and ar_SA. macOS builds don't reproduce the failure at all, which is why the earlier local verification passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
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
#42 added
-H:IncludeLocales=(empty value) intending to embed all locales, but on GraalVM that value doesn't mean "all".The empty string is parsed as a single language tag; only
-H:+IncludeAllLocalesadds every available locale.The resulting image is identical to one built with no locale flag, so the Linux release binaries most likely still abort at startup in protobuf-java's
RuntimeVersion.<clinit>:Fix: switch to
-H:+IncludeAllLocales.It isn't deprecated, either on GraalVM 21.0.2 (what CI uses) or on current GraalVM master; the deprecated option there is
-H:DefaultLocale.The trade-off is size: roughly +22MB per binary.
Verification
Reproduced with
protoc-gen-markdown, which has the same protobuf-java path and native-image flags.The failure only shows up on Linux builds where the builder locale is
C.UTF-8, as on the GitHub runners.macOS builds start fine regardless, which is why the macOS verification in #42 passed.
Built in a
ghcr.io/graalvm/native-image-community:21.0.2container withLANG=C.UTF-8, then ran each binary indebian:stable-slimunderC.UTF-8,en_US,de_DE,ja_JPandar_SA:FormatData_en_US)-H:IncludeLocales=-H:+IncludeAllLocalesCompanion PRs: engine-public/protoc-gen-markdown#17 and engine-public/protoc-gen-mermaid#14.
Test plan
protoc-gen-openapistarts withoutMissingReflectionRegistrationError🤖 Generated with Claude Code