googleapis / java-shared-config

Shared Maven build configuration for Google Cloud Java client libraries.
Apache License 2.0
19 stars 15 forks source link

feat: update graal-sdk to 24 and graalvm-A to 21.x #815

Open mpeddada1 opened 2 months ago

mpeddada1 commented 2 months ago

Also verified locally with java-kms (logs).

Noting two significant changes in PR:

mpeddada1 commented 2 months ago

In JDK 21, ITHttpAnnotation fails with:

 [ERROR] Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.460 s <<< FAILURE! -- in com.google.showcase.v1beta1.it.ITHttpAnnotation
Step #1: [ERROR] com.google.showcase.v1beta1.it.ITHttpAnnotation.testComplianceGroup[Compliance Group Name: Fully working conversions, no resources] -- Time elapsed: 0.031 s <<< ERROR!
Step #1: com.google.api.gax.rpc.InvalidArgumentException: Bad Request
Step #1:    at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:52)
Step #1:    at com.google.api.gax.httpjson.HttpJsonApiExceptionFactory.createApiException(HttpJsonApiExceptionFactory.java:76)
Step #1:    at com.google.api.gax.httpjson.HttpJsonApiExceptionFactory.create(HttpJsonApiExceptionFactory.java:54)
Step #1:    at com.google.api.gax.httpjson.HttpJsonExceptionCallable$ExceptionTransformingFuture.onFailure(HttpJsonExceptionCallable.java:97)
. . .
Step #1: Caused by: com.google.api.client.http.HttpResponseException: 400 Bad Request
Step #1: POST http://localhost:7469/v1beta1/repeat:body
Step #1: {"error":{"code":400,"message":"error reading body params '*': proto: syntax error (line 1:513): invalid value \u0000","details":null,"Body":"","Header":null,"Errors":null}}
Step #1:    at com.google.api.client.http.HttpResponseException$Builder.build(HttpResponseException.java:293)
Step #1:    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1118)
Step #1:    at com.google.api.gax.httpjson.HttpRequestRunnable.run(HttpRequestRunnable.java:115)
Step #1:    ... 6 more

However, the same test passes in JDK 11.

mpeddada1 commented 2 months ago

Running the same test multiple times locally on JDK 21 shows this test to failing 15/20 times

Screenshot 2024-04-25 at 6 29 20 PM
mpeddada1 commented 2 months ago

Created issue to track ITHttpAnnotation failure in https://github.com/googleapis/sdk-platform-java/issues/2695

mpeddada1 commented 2 months ago

downstream / dependencies (11, java-spanner) is resulting in:

[INFO] --- maven-dependency-plugin:3.5.0:analyze (default-cli) @ google-cloud-spanner ---
Error:  Used undeclared dependencies found:
Error:     org.graalvm.sdk:nativeimage:jar:24.0.1:provided

According to the graal/sdk CHANGELOG, the GraalVM SDK was split into smaller modules and the use of graal-sdk is deprecated. The new maven configuration to customize native image generation is:

<dependency>
  <groupId>org.graalvm.sdk</groupId>
  <artifactId>nativeimage</artifactId>
  <version>${graalvm.version}</version>
</dependency>

java-spanner's pom needs to be updated to ignore the provided org.graalvm.sdk:nativeimage dependency: https://github.com/googleapis/java-spanner/blob/206534cb410c2ba2f4099a4fb5fb414e05ba07a4/google-cloud-spanner/pom.xml#L153

burkedavison commented 2 months ago

Do not merge until https://github.com/googleapis/sdk-platform-java/issues/2695 is resolved