Skip to content

Commit e61cbdd

Browse files
authored
fix: graalvm missing build time class when using protobuf 4.x (#3438)
In case of protobuf 4+ need to include protobuf.Runtime in classes initialized at build time as that is used to determine protobuf version for graalvm. Tested, temporarily bumped protobuf dependency to 4.28.1 without including Runtime in build time class list. Received error: ``` Error: Classes that should be initialized at run time got initialized during image building: com.google.protobuf.RuntimeVersion was unintentionally initialized at build time. To see why com.google.protobuf.RuntimeVersion got initialized use --trace-class-initialization=com.google.protobuf.RuntimeVersion ``` Updated to include Runtime and received passing [native showcase tests](https://github.com/googleapis/sdk-platform-java/actions/runs/12205342463/job/34052473211?pr=3438)
1 parent 124e82a commit e61cbdd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sdk-platform-java/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/native-image.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Args = --enable-url-protocols=https,http \
33
org.junit.platform.engine.TestTag,\
44
com.google.api.gax.core.GaxProperties,\
55
com.google.common.base.Platform,\
6-
com.google.common.base.Platform$JdkPatternCompiler \
6+
com.google.common.base.Platform$JdkPatternCompiler,\
7+
com.google.protobuf.RuntimeVersion \
78
--features=com.google.api.gax.nativeimage.OpenCensusFeature,\
89
com.google.api.gax.nativeimage.GoogleJsonClientFeature \
910
--add-modules=jdk.httpserver

0 commit comments

Comments
 (0)