-
Notifications
You must be signed in to change notification settings - Fork 15.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bazel: Bump java source and target language level to java 8 #6711
Closed
davido
wants to merge
1
commit into
protocolbuffers:3.10.x
from
davido:bazel_bump_default_java_language_source_and_target_level_to_java_8
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that we are going to drop Java 7 support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we would like to drop Java 7 support soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is: Java 11 doesn't support building with language level 7. Moreover, Bazel switched to using JDK 11 internally, and the console is spammed with spurious warning messages:
in many issue trackers: [1], [2].
But I see now, that Maven build doing something similar in
java/pom.xml
so that this PR is incomplete:But personally, I don't care about Maven. Would it be an option to remove Java 7 support for Bazel driven build, so to say merge this PR as is, but let Maven world untouched? That way all bazel friends in the wild wouldn't see these annoying warnings, for each and every
java_proto_library
rules in their own and transitive dependencies BUILD files.For example in Gerrit Code Review, I am seeing these warnings dozen times:
[1] bazelbuild/bazel#8772
[2] https://bugs.chromium.org/p/gerrit/issues/detail?id=11102
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. We don't want existing JDK 7 users to be stuck in an old version of Protobuf. But since you are saying Java 11 doesn't support building language level 7 and Bazel switched to using JDK 11, does this mean there are currently no Bazel users who are using JDK 7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologize, my bad. Java 11, 13 and even 14 version still support java language level 7 (byte code major version 51).
This issue is entirely a Bazel bug (incompatibility of two Java compiler options) and should be be fixed in Bazel instead. Sorry for the noise.
Having said that, you should consider to discontinue Java 7 language level support in future Protobuf releases.
The most recent JDK 13 and upcoming JDK 14 release already issue this warning. JDK 13:
JDK 14: