From 8b4eb0c8c1f28c6d15c31d16853049d04f048291 Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Fri, 6 Jan 2023 11:30:54 -0500 Subject: [PATCH] Fix usage of protoc-gen-go-binary (#15920) * Fix usage of protoc-gen-go-binary * Pin protoc-gen-go-binary version --- GNUmakefile | 1 + build-support/scripts/devtools.sh | 8 ++++++-- proto-public/annotations/ratelimit/ratelimit.pb.binary.go | 2 +- proto-public/buf.gen.yaml | 2 ++ proto-public/pbacl/acl.pb.binary.go | 2 +- proto-public/pbconnectca/ca.pb.binary.go | 2 +- proto-public/pbdataplane/dataplane.pb.binary.go | 2 +- proto-public/pbdns/dns.pb.binary.go | 2 +- .../pbserverdiscovery/serverdiscovery.pb.binary.go | 2 +- proto/buf.gen.yaml | 2 ++ proto/pbacl/acl.pb.binary.go | 2 +- proto/pbautoconf/auto_config.pb.binary.go | 2 +- proto/pbcommon/common.pb.binary.go | 2 +- proto/pbconfig/config.pb.binary.go | 2 +- proto/pbconfigentry/config_entry.pb.binary.go | 2 +- proto/pbconnect/connect.pb.binary.go | 2 +- proto/pboperator/operator.pb.binary.go | 2 +- proto/pbpeering/peering.pb.binary.go | 2 +- proto/pbpeerstream/peerstream.pb.binary.go | 2 +- proto/pbservice/healthcheck.pb.binary.go | 2 +- proto/pbservice/node.pb.binary.go | 2 +- proto/pbservice/service.pb.binary.go | 2 +- proto/pbstatus/status.pb.binary.go | 2 +- proto/pbsubscribe/subscribe.pb.binary.go | 2 +- 24 files changed, 31 insertions(+), 22 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 2b7ba980a3..268a9aae23 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -13,6 +13,7 @@ BUF_VERSION='v1.4.0' PROTOC_GEN_GO_GRPC_VERSION="v1.2.0" MOG_VERSION='v0.3.0' PROTOC_GO_INJECT_TAG_VERSION='v1.3.0' +PROTOC_GEN_GO_BINARY_VERSION="v0.1.0" DEEP_COPY_VERSION='bc3f5aa5735d8a54961580a3a24422c308c831c2' MOCKED_PB_DIRS= pbdns diff --git a/build-support/scripts/devtools.sh b/build-support/scripts/devtools.sh index 91281c6016..b5c0e52cd3 100755 --- a/build-support/scripts/devtools.sh +++ b/build-support/scripts/devtools.sh @@ -73,6 +73,8 @@ function proto_tools_install { mog_version="$(make --no-print-directory print-MOG_VERSION)" protoc_go_inject_tag_version="$(make --no-print-directory print-PROTOC_GO_INJECT_TAG_VERSION)" buf_version="$(make --no-print-directory print-BUF_VERSION)" + protoc_gen_go_binary_version="$(make --no-print-directory print-PROTOC_GEN_GO_BINARY_VERSION)" + # echo "go: ${protoc_gen_go_version}" # echo "mog: ${mog_version}" @@ -102,9 +104,11 @@ function proto_tools_install { "${protoc_gen_go_grpc_version}" \ 'google.golang.org/grpc/cmd/protoc-gen-go-grpc' - install_unversioned_tool \ + install_versioned_tool \ protoc-gen-go-binary \ - 'github.com/hashicorp/protoc-gen-go-binary@master' + 'github.com/hashicorp/protoc-gen-go-binary' \ + "${protoc_gen_go_binary_version}" \ + 'github.com/hashicorp/protoc-gen-go-binary' install_versioned_tool \ 'protoc-go-inject-tag' \ diff --git a/proto-public/annotations/ratelimit/ratelimit.pb.binary.go b/proto-public/annotations/ratelimit/ratelimit.pb.binary.go index bc1170ccd3..316afdc87e 100644 --- a/proto-public/annotations/ratelimit/ratelimit.pb.binary.go +++ b/proto-public/annotations/ratelimit/ratelimit.pb.binary.go @@ -4,7 +4,7 @@ package ratelimit import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto-public/buf.gen.yaml b/proto-public/buf.gen.yaml index d29f2701d3..8a878a3d33 100644 --- a/proto-public/buf.gen.yaml +++ b/proto-public/buf.gen.yaml @@ -20,6 +20,8 @@ plugins: - require_unimplemented_servers=false - name: go-binary out: . + opt: + - paths=source_relative - name: consul-rate-limit out: . opt: diff --git a/proto-public/pbacl/acl.pb.binary.go b/proto-public/pbacl/acl.pb.binary.go index 39fa549572..63284c9ce9 100644 --- a/proto-public/pbacl/acl.pb.binary.go +++ b/proto-public/pbacl/acl.pb.binary.go @@ -4,7 +4,7 @@ package pbacl import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto-public/pbconnectca/ca.pb.binary.go b/proto-public/pbconnectca/ca.pb.binary.go index f0f36f2feb..5b5821c7ac 100644 --- a/proto-public/pbconnectca/ca.pb.binary.go +++ b/proto-public/pbconnectca/ca.pb.binary.go @@ -4,7 +4,7 @@ package pbconnectca import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto-public/pbdataplane/dataplane.pb.binary.go b/proto-public/pbdataplane/dataplane.pb.binary.go index c08cd112ba..6a754a0f22 100644 --- a/proto-public/pbdataplane/dataplane.pb.binary.go +++ b/proto-public/pbdataplane/dataplane.pb.binary.go @@ -4,7 +4,7 @@ package pbdataplane import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto-public/pbdns/dns.pb.binary.go b/proto-public/pbdns/dns.pb.binary.go index 486c4ff887..c49eeb5eb3 100644 --- a/proto-public/pbdns/dns.pb.binary.go +++ b/proto-public/pbdns/dns.pb.binary.go @@ -4,7 +4,7 @@ package pbdns import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto-public/pbserverdiscovery/serverdiscovery.pb.binary.go b/proto-public/pbserverdiscovery/serverdiscovery.pb.binary.go index a2e291967a..645d83eed5 100644 --- a/proto-public/pbserverdiscovery/serverdiscovery.pb.binary.go +++ b/proto-public/pbserverdiscovery/serverdiscovery.pb.binary.go @@ -4,7 +4,7 @@ package pbserverdiscovery import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index adfc2cb95f..cd296f741a 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -21,6 +21,8 @@ plugins: - require_unimplemented_servers=false - name: go-binary out: . + opt: + - paths=source_relative - name: consul-rate-limit out: . opt: diff --git a/proto/pbacl/acl.pb.binary.go b/proto/pbacl/acl.pb.binary.go index 173901eb73..9f93a6f174 100644 --- a/proto/pbacl/acl.pb.binary.go +++ b/proto/pbacl/acl.pb.binary.go @@ -4,7 +4,7 @@ package pbacl import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbautoconf/auto_config.pb.binary.go b/proto/pbautoconf/auto_config.pb.binary.go index 20b68242ab..4fc5f7fbe0 100644 --- a/proto/pbautoconf/auto_config.pb.binary.go +++ b/proto/pbautoconf/auto_config.pb.binary.go @@ -4,7 +4,7 @@ package pbautoconf import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbcommon/common.pb.binary.go b/proto/pbcommon/common.pb.binary.go index 4fa371c5fe..9252044934 100644 --- a/proto/pbcommon/common.pb.binary.go +++ b/proto/pbcommon/common.pb.binary.go @@ -4,7 +4,7 @@ package pbcommon import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbconfig/config.pb.binary.go b/proto/pbconfig/config.pb.binary.go index e8f6aa1c4a..a978adc8a6 100644 --- a/proto/pbconfig/config.pb.binary.go +++ b/proto/pbconfig/config.pb.binary.go @@ -4,7 +4,7 @@ package pbconfig import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbconfigentry/config_entry.pb.binary.go b/proto/pbconfigentry/config_entry.pb.binary.go index 63b8c32a0b..e03322294c 100644 --- a/proto/pbconfigentry/config_entry.pb.binary.go +++ b/proto/pbconfigentry/config_entry.pb.binary.go @@ -4,7 +4,7 @@ package pbconfigentry import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbconnect/connect.pb.binary.go b/proto/pbconnect/connect.pb.binary.go index ff4d44ee70..181211db17 100644 --- a/proto/pbconnect/connect.pb.binary.go +++ b/proto/pbconnect/connect.pb.binary.go @@ -4,7 +4,7 @@ package pbconnect import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pboperator/operator.pb.binary.go b/proto/pboperator/operator.pb.binary.go index 594bcde67f..51f4fa3d81 100644 --- a/proto/pboperator/operator.pb.binary.go +++ b/proto/pboperator/operator.pb.binary.go @@ -4,7 +4,7 @@ package pboperator import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbpeering/peering.pb.binary.go b/proto/pbpeering/peering.pb.binary.go index 7aca179a80..30772dcd6c 100644 --- a/proto/pbpeering/peering.pb.binary.go +++ b/proto/pbpeering/peering.pb.binary.go @@ -4,7 +4,7 @@ package pbpeering import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbpeerstream/peerstream.pb.binary.go b/proto/pbpeerstream/peerstream.pb.binary.go index 04531399a1..87c4e7bec6 100644 --- a/proto/pbpeerstream/peerstream.pb.binary.go +++ b/proto/pbpeerstream/peerstream.pb.binary.go @@ -4,7 +4,7 @@ package pbpeerstream import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbservice/healthcheck.pb.binary.go b/proto/pbservice/healthcheck.pb.binary.go index f46fb01e0b..6971555ee0 100644 --- a/proto/pbservice/healthcheck.pb.binary.go +++ b/proto/pbservice/healthcheck.pb.binary.go @@ -4,7 +4,7 @@ package pbservice import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbservice/node.pb.binary.go b/proto/pbservice/node.pb.binary.go index f1e2bec68c..feba45a1d9 100644 --- a/proto/pbservice/node.pb.binary.go +++ b/proto/pbservice/node.pb.binary.go @@ -4,7 +4,7 @@ package pbservice import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbservice/service.pb.binary.go b/proto/pbservice/service.pb.binary.go index b3c7437673..8eab0ff9e7 100644 --- a/proto/pbservice/service.pb.binary.go +++ b/proto/pbservice/service.pb.binary.go @@ -4,7 +4,7 @@ package pbservice import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbstatus/status.pb.binary.go b/proto/pbstatus/status.pb.binary.go index f1dcfbf66b..160fad658b 100644 --- a/proto/pbstatus/status.pb.binary.go +++ b/proto/pbstatus/status.pb.binary.go @@ -4,7 +4,7 @@ package pbstatus import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler diff --git a/proto/pbsubscribe/subscribe.pb.binary.go b/proto/pbsubscribe/subscribe.pb.binary.go index 43b7c8f592..188eff1f57 100644 --- a/proto/pbsubscribe/subscribe.pb.binary.go +++ b/proto/pbsubscribe/subscribe.pb.binary.go @@ -4,7 +4,7 @@ package pbsubscribe import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MarshalBinary implements encoding.BinaryMarshaler