-
Notifications
You must be signed in to change notification settings - Fork 3.9k
compiler: Default to @generated=omit #12080
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
Conversation
After many years of issue 9179 being open, there's been nothing to show that we need the javax.annotations.Generated annotation. Most tools use file paths and a few check for annotations with "Generated" in the name. ErrorProne has a few that check for javax.annotations.Generated, but only UnnecessarilyFullyQualified looks like it'd be a problem and it is disabled by default. We're not getting any more information, no users have reported issues with `@generated=omit`, and the existing dependency is annoying users, so just drop it. Given we will still retain the GrpcGenerated annotation, it seems highly likely things are already okay. Even if there are problems they would probably be addressed by adding a io.grpc.stub.annotations.Generated annotation or small tweaks. In the short-term, (non-Bazel) users can use `@generated=javax`, but long-term we could consider removing the option assuming we've resolved any outstanding issues. We will want to update the examples and the README to remove the org.apache.tomcat:annotations-api dependency after the next release. Fixes grpc#9179
@@ -15,12 +15,3 @@ java_library( | |||
artifact("org.codehaus.mojo:animal-sniffer-annotations"), | |||
], | |||
) | |||
|
|||
# javax.annotation.Generated is not included in the default root modules in 9, |
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.
As we are removing this we should not say in the PR description that bazel users can still use generated="javax" in the short term, right?
Update: (after seeing the boq CL) Or we are saying they can get the javax annotations emitted but should not actually check for its presence in the classpath?
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 mentioned that only non-Bazel users can use that workaround, but I could have called it out more.
(non-Bazel) users can use
@generated=javax
But yes, Bazel users don't get a choice.
We don't support any toolchain overriding in Bazel currently, so our toolchain is always used:
grpc-java/java_grpc_library.bzl
Lines 136 to 138 in 2fb0957
"_toolchain": attr.label( | |
default = Label("//compiler:java_grpc_library_toolchain"), | |
), |
We can change all Bazel usages to include the @generated=javax
, but there's not a mechanism to let specific people override it... I guess except for someone patching our repository.
After many years of issue 9179 being open, there's been nothing to show that we need the javax.annotations.Generated annotation. Most tools use file paths and a few check for annotations with "Generated" in the name. ErrorProne has a few that check for javax.annotations.Generated, but only UnnecessarilyFullyQualified looks like it'd be a problem and it is disabled by default. We're not getting any more information, no users have reported issues with `@generated=omit`, and the existing dependency is annoying users, so just drop it. Given we will still retain the GrpcGenerated annotation, it seems highly likely things are already okay. Even if there are problems they would probably be addressed by adding a io.grpc.stub.annotations.Generated annotation or small tweaks. In the short-term, (non-Bazel) users can use `@generated=javax`, but long-term we could consider removing the option assuming we've resolved any outstanding issues. We will want to update the examples and the README to remove the org.apache.tomcat:annotations-api dependency after the next release. Fixes grpc#9179
After many years of issue 9179 being open, there's been nothing to show that we need the javax.annotations.Generated annotation. Most tools use file paths and a few check for annotations with "Generated" in the name. ErrorProne has a few that check for precisely "Generated", but only UnnecessarilyFullyQualified looks like it'd be a problem and it is disabled by default. We're not getting any more information, no users have reported issues with
@generated=omit
, and the existing dependency is annoying users, so just drop it.Given we will still retain the GrpcGenerated annotation, it seems highly likely things are already okay. Even if there are problems they would probably be addressed by adding a io.grpc.stub.annotations.Generated annotation or small tweaks. In the short-term, (non-Bazel) users can use
@generated=javax
, but long-term we could consider removing the option assuming we've resolved any outstanding issues.We will want to update the examples and the README to remove the org.apache.tomcat:annotations-api dependency after the next release.
Fixes #9179