Skip to content

Commit ffbb62b

Browse files
authored
Swap to using google.golang.org/protobuf/cmd/protoc-gen-go instead of github.com/golang/protobuf/protoc-gen-go (#37685)
* Reformat Args in steps definitions * Swap to using the new version of protoc-gen-go that doesn't include grpc support (instead it relies on protoc-gen-go-grpc). Update command flags to reflect this change in tooling. See this comment for explanation: golang/protobuf#1070 (comment) * Run `make protobuf` with problem generate steps commented out. * Use `require_unimplemented_servers=false` to minimise changes at the time of upgrading tooling In future we can navigate the consequences of this in its own PR. * WIP * Fix out/opt typo, add remaining flags once terraform1.proto was being found ok * Run `make protobuf` * `go get google.golang.org/grpc/cmd/[email protected]` && `go mod tidy` This version includes a feature that allows the copyright comment in the .proto file to be pulled across to generated _grpc.pb.go files. * Run `make protobuf` with new version of protoc-gen-go-grpc that allows copyright comment to be copied to generated output files * Potential fix for `internal/rpcapi/dynrpcserver/generator`
1 parent 0217dd2 commit ffbb62b

File tree

20 files changed

+5274
-4836
lines changed

20 files changed

+5274
-4836
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ require (
8282
golang.org/x/tools v0.36.0
8383
golang.org/x/tools/cmd/cover v0.1.0-deprecated
8484
google.golang.org/grpc v1.69.4
85-
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0
85+
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
8686
google.golang.org/protobuf v1.36.6
8787
honnef.co/go/tools v0.6.0
8888
)

go.sum

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,8 +1278,8 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG
12781278
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
12791279
google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A=
12801280
google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
1281-
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 h1:TLkBREm4nIsEcexnCjgQd5GQWaHcqMzwQV0TX9pq8S0=
1282-
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY=
1281+
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA=
1282+
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y=
12831283
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
12841284
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
12851285
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -1292,7 +1292,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
12921292
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
12931293
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
12941294
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
1295-
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
12961295
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
12971296
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
12981297
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=

internal/cloudplugin/cloudproto1/cloudproto1.pb.go

Lines changed: 0 additions & 113 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/cloudplugin/cloudproto1/cloudproto1_grpc.pb.go

Lines changed: 139 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/rpcapi/dynrpcserver/generator/main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ func main() {
9494
filename := toFilenameCase(baseName) + ".go"
9595
absFilename := filepath.Join(outDir, filename)
9696

97+
if regexp.MustCompile("^Unsafe").MatchString(ifaceName) {
98+
// This isn't a gRPC server interface, so skip it.
99+
//
100+
// This is an interface that's intended to be embedded to help users to meet requirements for Unimplemented servers.
101+
// See:
102+
// > Docs: https://pkg.go.dev/google.golang.org/grpc/cmd/protoc-gen-go-grpc#readme-future-proofing-services
103+
// > PR for Unsafe interfaces: https://github.com/grpc/grpc-go/pull/3911
104+
continue Types
105+
}
106+
97107
var buf bytes.Buffer
98108

99109
fmt.Fprintf(&buf, `// Copyright (c) HashiCorp, Inc.

0 commit comments

Comments
 (0)