You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is currently no simple way to use the (wonderful) new 1.64.0 feature @generated=omit from Bazel. Which leaves Bazel users with a superfluous dependency for a single annotation.
It might be possible to do so with a new toolchain, but that's a lot of effort for a minor feature. If that doesn't work either, it's probably impossible. This might also be related to #11097
Describe the solution you'd like
Either set it to omit by default or add an option to change it.
It can occur more than once. It might even be worth it to also use this instead of the lite/non-lite toolchains.
Describe alternatives you've considered
I tried a .bazelrc entry with build --protocopt=--rpc-plugin_opt=@generated=omit - but that failed. The descriptors are created before the plugin is called, the option is unknown at that point and the command fails.
Additional context
The text was updated successfully, but these errors were encountered:
I think this is mostly infeasible/not worth the effort. Even without the @Generated annotation, your dependencies wouldn't change and you'd still depend on the old j2ee stuff.
Yes, with specific toolchain plumbing that could maybe be managed, but that's a lot of effort for this neverlink=1 dependency. It'd be much easier for someone to just pick up #9179.
@Hc747, please actually read the beginning of #9179. Its title is "Replace javax.annotation.Generated with custom gRPC annotation," which is quite different than that PR.
Is your feature request related to a problem?
There is currently no simple way to use the (wonderful) new 1.64.0 feature
@generated=omit
from Bazel. Which leaves Bazel users with a superfluous dependency for a single annotation.It might be possible to do so with a new toolchain, but that's a lot of effort for a minor feature. If that doesn't work either, it's probably impossible. This might also be related to #11097
Describe the solution you'd like
Either set it to omit by default or add an option to change it.
https://github.com/grpc/grpc-java/blob/v1.64.0/java_grpc_library.bzl#L95 looks like the right place;
args.add("--rpc-plugin_opt=@generated={0}".format(<???>))
behind a conditional (only if non-default) should do the trick - with a new attribute in the rules below.The
..._opt
flag to set the CodeGeneratorRequest.parameter for a plugin is not well documented, but is referenced e.g. here: protocolbuffers/protobuf#4759 (comment) (EDIT: a better reference would be https://github.com/protocolbuffers/protobuf/blob/v26.1/src/google/protobuf/compiler/command_line_interface.h#L107-L175)It can occur more than once. It might even be worth it to also use this instead of the lite/non-lite toolchains.
Describe alternatives you've considered
I tried a
.bazelrc
entry withbuild --protocopt=--rpc-plugin_opt=@generated=omit
- but that failed. The descriptors are created before the plugin is called, the option is unknown at that point and the command fails.Additional context
The text was updated successfully, but these errors were encountered: