Skip to content

ci: Use Java 8 for Linkage Checker#3716

Merged
lqiu96 merged 7 commits intomainfrom
use-java-8-compatibility-ci
Mar 24, 2025
Merged

ci: Use Java 8 for Linkage Checker#3716
lqiu96 merged 7 commits intomainfrom
use-java-8-compatibility-ci

Conversation

@lqiu96
Copy link
Copy Markdown
Member

@lqiu96 lqiu96 commented Mar 19, 2025

@lqiu96 lqiu96 requested a review from suztomo March 19, 2025 18:03
@product-auto-label product-auto-label Bot added the size: xs Pull request size is extra small. label Mar 19, 2025
@lqiu96
Copy link
Copy Markdown
Member Author

lqiu96 commented Mar 19, 2025

Two odd class file version issues:

  1. Datatstore
Error: Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/cloud/datastore/emulator/CloudDatastore has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
  1. Spanner
Error:  COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
Error:  /home/runner/work/sdk-platform-java/sdk-platform-java/java-spanner/google-cloud-spanner/src/main/java/com/google/cloud/spanner/nativeimage/SpannerFeature.java:[20,38] cannot access org.graalvm.nativeimage.hosted.Feature
  bad class file: /home/runner/.m2/repository/org/graalvm/sdk/nativeimage/24.1.2/nativeimage-24.1.2.jar(org/graalvm/nativeimage/hosted/Feature.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

@product-auto-label product-auto-label Bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Mar 19, 2025
Copy link
Copy Markdown
Member

@suztomo suztomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please confirm using Java 17 in compilation can catch Protobuf 4.30.1's Java 8 incompatibility issue or not.

Comment thread .github/workflows/downstream_protobuf_compatibility_check_nightly.yaml Outdated
Comment thread .kokoro/nightly/downstream-protobuf-binary-compatibility.sh Outdated
@lqiu96 lqiu96 force-pushed the use-java-8-compatibility-ci branch from 511679f to 1db9b69 Compare March 19, 2025 20:39
@product-auto-label product-auto-label Bot added size: xs Pull request size is extra small. and removed size: s Pull request size is small. labels Mar 19, 2025
@lqiu96
Copy link
Copy Markdown
Member Author

lqiu96 commented Mar 19, 2025

Ah, Downstream tests cannot use Java 8 for compilation: #3717. This is also documented go/cloud-java-native-image#class-file-has-wrong-version-550-should-be-530 (thanks @mpeddada1)

I believe we must compile the client libraries with JDK 11+. Closing this PR. I think we will have to find a different solution to try to compile the client libraries using Protobuf 4.x and JDK 8.

CC: @suztomo

@lqiu96 lqiu96 closed this Mar 19, 2025
@lqiu96 lqiu96 reopened this Mar 19, 2025
@lqiu96
Copy link
Copy Markdown
Member Author

lqiu96 commented Mar 19, 2025

This seems a bit odd that the downstream tests failed for all client librarires when using Java 8, but it was able to compile and run unit tests and pass for most handwritten libraries using Java 8 in this PR.

Going to run another invocation to see

@product-auto-label product-auto-label Bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Mar 24, 2025
@lqiu96 lqiu96 marked this pull request as ready for review March 24, 2025 15:43
@lqiu96 lqiu96 requested a review from suztomo March 24, 2025 15:43
@suztomo
Copy link
Copy Markdown
Member

suztomo commented Mar 24, 2025

There are failure in the check in this pull request as well as your invocation:

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s -- in com.google.cloud.datastore.aggregation.CountAggregationTest
[INFO] 
[INFO] Results:
[INFO] 
Error:  Errors: 
Error:    DatastoreTest.afterClass:196 » Connect Connection refused (Connection refused)
Error:    DatastoreTest.setUp:189 » Datastore I/O error

@sonarqubecloud
Copy link
Copy Markdown

Please retry analysis of this Pull-Request directly on SonarQube Cloud

@suztomo
Copy link
Copy Markdown
Member

suztomo commented Mar 24, 2025

It passed.

Comment thread .kokoro/nightly/downstream-protobuf-source-compatibility.sh Outdated
@sonarqubecloud
Copy link
Copy Markdown

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@lqiu96 lqiu96 enabled auto-merge (squash) March 24, 2025 20:05
@lqiu96 lqiu96 merged commit 20f2fa4 into main Mar 24, 2025
65 of 67 checks passed
@lqiu96 lqiu96 deleted the use-java-8-compatibility-ci branch March 24, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants