Skip to content

Commit 7ca84fa

Browse files
authored
Update to latest Protobuf 21.3 release (vitessio#10803)
This updates to the latest Protobuf release (where they seem to have dropped the 3 prefix as well). The version has MacOS arm64 binaries as well, so we can remove the Homebrew path. The homebrew path was broken as well, because we'd alias whichever version of protobuf was installed as 3.19.4 even if it's a different version. That in turn leads to always having diffs in the generated protobuf code, thus also failing CI or having to manually fix up generated code. Updating this and having a fixed binary in place resolves that issue as well. Signed-off-by: Dirkjan Bussink <[email protected]>
1 parent f173307 commit 7ca84fa

36 files changed

+41
-67
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ $(PROTO_GO_OUTS): minimaltools install_protoc-gen-go proto/*.proto
246246
--go-vtproto_opt=features=marshal+unmarshal+size+pool \
247247
--go-vtproto_opt=pool=vitess.io/vitess/go/vt/proto/query.Row \
248248
--go-vtproto_opt=pool=vitess.io/vitess/go/vt/proto/binlogdata.VStreamRowsResponse \
249-
-I${PWD}/dist/vt-protoc-3.19.4/include:proto $(PROTO_SRCS)
249+
-I${PWD}/dist/vt-protoc-21.3/include:proto $(PROTO_SRCS)
250250
cp -Rf vitess.io/vitess/go/vt/proto/* go/vt/proto
251251
rm -rf vitess.io/vitess/go/vt/proto/
252252

bootstrap.sh

+6-32
Original file line numberDiff line numberDiff line change
@@ -107,42 +107,16 @@ install_protoc() {
107107
aarch64) local target=aarch_64;;
108108
x86_64) local target=x86_64;;
109109
arm64) case "$platform" in
110-
osx) local use_homebrew=1;;
110+
osx) local target=aarch_64;;
111111
*) echo "ERROR: unsupported architecture for protoc"; exit 1;;
112112
esac;;
113113
*) echo "ERROR: unsupported architecture for protoc"; exit 1;;
114114
esac
115115

116-
# TODO (ajm188): remove this branch after protoc includes signed protoc binaries for M1 Macs.
117-
if [[ "$use_homebrew" -eq 1 ]]; then
118-
cat >&2 <<WARNING
119-
WARN: Protobuf does not have a protoc binary for arm64 macos.
120-
Checking for homebrew installation. Altertatively, you may install the x86-64
121-
version if you have Rosetta installed; your mileage may vary.
122-
123-
See https://github.com/protocolbuffers/protobuf/issues/9397.
124-
WARNING
125-
126-
if [[ -z "$(command -v brew)" ]]; then
127-
echo "Could not find \`brew\` command. Please install homebrew and retry." >&2;
128-
exit 1;
129-
fi
130-
131-
brew install protobuf;
132-
protobuf_base="$(brew list protobuf | grep -E 'LICENSE$' | sed 's:/LICENSE$::')"
133-
if [[ -z "$protobuf_base" ]]; then
134-
echo "Could not find \`protobuf\` directory after installing. Please verify the output of \`brew info protobuf\`" >&2;
135-
exit 1;
136-
fi
137-
138-
ln -snf "${protobuf_base}/bin" "${dist}/bin"
139-
ln -snf "${protobuf_base}/include" "${dist}/include"
140-
else
141-
# This is how we'd download directly from source:
142-
# wget https://github.com/protocolbuffers/protobuf/releases/download/v$version/protoc-$version-$platform-${target}.zip
143-
$VTROOT/tools/wget-retry "${VITESS_RESOURCES_DOWNLOAD_URL}/protoc-$version-$platform-${target}.zip"
144-
unzip "protoc-$version-$platform-${target}.zip"
145-
fi
116+
# This is how we'd download directly from source:
117+
$VTROOT/tools/wget-retry https://github.com/protocolbuffers/protobuf/releases/download/v$version/protoc-$version-$platform-${target}.zip
118+
#$VTROOT/tools/wget-retry "${VITESS_RESOURCES_DOWNLOAD_URL}/protoc-$version-$platform-${target}.zip"
119+
unzip "protoc-$version-$platform-${target}.zip"
146120

147121
ln -snf "$dist/bin/protoc" "$VTROOT/bin/protoc"
148122
}
@@ -291,7 +265,7 @@ install_all() {
291265
echo "##local system details..."
292266
echo "##platform: $(uname) target:$(get_arch) OS: $os"
293267
# protoc
294-
protoc_ver=3.19.4
268+
protoc_ver=21.3
295269
install_dep "protoc" "$protoc_ver" "$VTROOT/dist/vt-protoc-$protoc_ver" install_protoc
296270

297271
# zk

go/vt/proto/automation/automation.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/automationservice/automationservice.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/automationservice/automationservice_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/binlogdata/binlogdata.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/binlogservice/binlogservice.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/binlogservice/binlogservice_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/logutil/logutil.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/mysqlctl/mysqlctl.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/mysqlctl/mysqlctl_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/query/query.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/queryservice/queryservice.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/queryservice/queryservice_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/replicationdata/replicationdata.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/tableacl/tableacl.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/throttlerdata/throttlerdata.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/throttlerservice/throttlerservice.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/throttlerservice/throttlerservice_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/topodata/topodata.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vschema/vschema.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vtadmin/vtadmin.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vtadmin/vtadmin_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vtctldata/vtctldata.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vtctlservice/vtctlservice.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vtctlservice/vtctlservice_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vtgate/vtgate.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vtgateservice/vtgateservice.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vtgateservice/vtgateservice_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vtrpc/vtrpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vttest/vttest.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/vttime/vttime.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/vt/proto/workflow/workflow.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)