-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Getting a deprecation warning message? #1104
Comments
The "github.com/golang/protobuf/protoc-gen-go/generator" package is the internal implementation of You're seeing the warning because either you are directly depending on the |
Thanks to @dsnet . |
Fix for this was merged grpc-ecosystem/grpc-gateway#1260 and released in the version https://github.com/grpc-ecosystem/grpc-gateway/releases/tag/v1.14.5 |
Commit `f18fcd9b` updated the following dependencies: - github.com/golang/protobuf: v1.3.2 => v1.4.2 - google.golang.org/genproto - google.golang.org/grpc: v1.26.0 => v1.27.0 However, the protobuf generated files were not re-generated which is what this commit addresses. The newly generated files should be backward compatible. However, the following warning is now emitted when generating them: WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated. A future release of golang/protobuf will delete this package, which has long been excluded from the compatibility promise. This is because this package was apparently never meant to be public as explained in this comment[0]. The fix for this is to migrate to `google.golang.org/protobuf/compiler/protogen` but this can't be done until a release of `grpc-go` which includes the following patch[1] is out. Update the Makefile to output a note with regard to this when generating the files It appears that with the newly generated files, protobuf now needs to be marked as an explicit dep. Fix it by by running: go mod tidy && go mod vendor && go mod verify Fix: f18fcd9 [0]: golang/protobuf#1104 (comment) [1]: grpc/grpc-go#3453 Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Commit `f18fcd9b` updated the following dependencies: - github.com/golang/protobuf: v1.3.2 => v1.4.2 - google.golang.org/genproto - google.golang.org/grpc: v1.26.0 => v1.27.0 However, the protobuf generated files were not re-generated which is what this commit addresses. The newly generated files should be backward compatible. However, the following warning is now emitted when generating them: WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated. A future release of golang/protobuf will delete this package, which has long been excluded from the compatibility promise. This is because this package was apparently never meant to be public as explained in this comment[0]. The fix for this is to migrate to `google.golang.org/protobuf/compiler/protogen` but this can't be done until a release of `grpc-go` which includes the following patch[1] is out. Update the Makefile to output a note with regard to this when generating the files It appears that with the newly generated files, protobuf now needs to be marked as an explicit dep. Fix it by by running: go mod tidy && go mod vendor && go mod verify Fix: f18fcd9 [0]: golang/protobuf#1104 (comment) [1]: grpc/grpc-go#3453 Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
This update requires non-trivial changes to the way we generate files from `proto` definitions: - Replace `github.com/golang/protobuf/protoc-gen-go` with `google.golang.org/grpc/cmd/protoc-gen-go-grpc`. The former is deprecated as it is an internal implementation of `protoc-gen-go`. For more information, see [0]. Note that this package is still imported by the following plugin that we use: `github.com/envoyproxy/protoc-gen-validate`. I have bumped the version to the latest one (v0.4.0) but there is no version nor PR yet that update the import path for this one so a warning is still being issued when we generate the files from the `proto` definitions. - All `proto` files now need to specify `option go_package`. - Update the Makefile to use the `paths=source_relative`. This allows removing the `RAW_GO_MAPPINGS` definition and it works fine with the new `go_package` option. Without this change, the files would be generated to a folder named after the `go_package` option relative to the `Makefile` (eg: `./github.com/cilium/cilium/api/v1/flow`). - Use new `go-grpc_out` option with `protoc`. This generates the gRPC realted Go code using the `protoc-gen-go-grpc` plugin. The `go_out` option does not generate gRPC related Go code anymore. [0]: golang/protobuf#1104 (comment) Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
This update requires non-trivial changes to the way we generate files from `proto` definitions: - Replace `github.com/golang/protobuf/protoc-gen-go` with `google.golang.org/grpc/cmd/protoc-gen-go-grpc`. The former is deprecated as it is an internal implementation of `protoc-gen-go`. For more information, see [0]. Note that this package is still imported by the following plugin that we use: `github.com/envoyproxy/protoc-gen-validate`. I have bumped the version to the latest one (v0.4.0) but there is no version nor PR yet that update the import path for this one so a warning is still being issued when we generate the files from the `proto` definitions. - All `proto` files now need to specify `option go_package`. - Update the Makefile to use the `paths=source_relative`. This allows removing the `RAW_GO_MAPPINGS` definition and it works fine with the new `go_package` option. Without this change, the files would be generated to a folder named after the `go_package` option relative to the `Makefile` (eg: `./github.com/cilium/cilium/api/v1/flow`). - Use new `go-grpc_out` option with `protoc`. This generates the gRPC realted Go code using the `protoc-gen-go-grpc` plugin. The `go_out` option does not generate gRPC related Go code anymore. [0]: golang/protobuf#1104 (comment) Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Could you please silence this warning, annotation, and lack of that dependency in the future would be good enough trigger to address it, I have many 3rd party dep, it is almost impossible to get rid of that message. Once it's broken all 3rd part-owner address the issue I would think. For now, any new release of my CLI is coming with this message, really messed up. |
This adds a `replace` statement to `go.mod` to force the newer version `1.14.x` of `github.com/grpc-ecosystem/grpc-gateway` to avoid the following warning in all the controller container logs: ``` WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated. A future release of golang/protobuf will delete this package, which has long been excluded from the compatibility promise. ``` More info [here](golang/protobuf#1104)
This adds a `replace` statement to `go.mod` to force the newer version `1.14.x` of `github.com/grpc-ecosystem/grpc-gateway` to avoid the following warning in all the controller container logs: ``` WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated. A future release of golang/protobuf will delete this package, which has long been excluded from the compatibility promise. ``` More info [here](golang/protobuf#1104)
Placing this in
|
Any idea why I'm getting this warning message?.
Running these commands
The text was updated successfully, but these errors were encountered: