Fix GraalVM native image build error#9593
Merged
normanmaurer merged 1 commit intonetty:masterfrom Sep 23, 2019
Merged
Conversation
See micronaut-projects/micronaut-grpc#8: ``` Error: Class that is marked for delaying initialization to run time got initialized during image building: io.netty.handler.codec.http2.Http2CodecUtil. Try marking this class for build-time initialization with --initialize-at-build-time=io.netty.handler.codec.http2.Http2CodecUtil Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception Error: Image build request failed with exit status 1 ``` After debugging, it seems the culprit is `io.netty.handler.codec.http2.Http2ClientUpgradeCodec`, which also needs runtime initialisation.
|
Can one of the admins verify this patch? |
Member
Member
|
@netty-bot test this please |
auke-
added a commit
to auke-/micronaut-grpc-graal
that referenced
this pull request
Sep 23, 2019
Contributor
|
I believe this fix is correct, from the offending class I can see: static {
UPGRADE_HEADERS = Collections.singletonList(Http2CodecUtil.HTTP_UPGRADE_SETTINGS_HEADER);
}Which depends on a class that must be initialized at runtime I'll let @vjovanov to analyse further as I believe he has more insights on how the compiler works. |
Contributor
|
All looks good, thanks! |
Member
|
@pete-woods can you please sign our ICLA and let me know once done: |
Contributor
Author
Done |
Member
|
@pete-woods thanks a lot |
normanmaurer
pushed a commit
that referenced
this pull request
Sep 23, 2019
Motivation: Error: Class that is marked for delaying initialization to run time got initialized during image building: io.netty.handler.codec.http2.Http2CodecUtil. Try marking this class for build-time initialization with --initialize-at-build-time=io.netty.handler.codec.http2.Http2CodecUtil Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception Error: Image build request failed with exit status 1 Modification: After debugging, it seems the culprit is io.netty.handler.codec.http2.Http2ClientUpgradeCodec, which also needs runtime initialisation. Result: Fixes #micronaut-projects/micronaut-grpc#8
This was referenced Mar 9, 2021
Open
Open
Open
Closed
This was referenced Mar 18, 2021
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.
Motivation:
Modification:
After debugging, it seems the culprit is
io.netty.handler.codec.http2.Http2ClientUpgradeCodec, which also needs runtime initialisation.Result:
Fixes #micronaut-projects/micronaut-grpc#8