From 00b3937e0ddf4e35d6a14c51bac18275bed42ac0 Mon Sep 17 00:00:00 2001 From: Lee Avital Date: Sun, 1 Sep 2024 17:53:47 -0400 Subject: [PATCH] Adjust constants in rakefile This PR renames: * protoc_binary/protoc_version -> protoc_legacy_binary/protoc_legacy_version * protoc_binary_2/protoc_version_2 -> protoc_binary/protoc_version For background, protobuf has two major versions: 2 and 3. The suffix for protoc_binary_2 implies that a 2.x series protobuf compiler is being used. But actually, protoc_binary_2 points to a 22.04 release, which is fairly new. Contrast with protoc_binary which is pointing to protoc 3.5.1 which has been deprecated for several years (it's not even listed as deprecated in the public list of [releases](https://protobuf.dev/support/version-support/)) This PR also initializes protoc_binary and protoc_legacy_binary to their ultimate values from the get go. Compare this to before where they were both being set to `protoc` and then getting updated in setup_proto This PR is purely a refactor, and does not change any generated code (this is proved by CI). After this PR, we should excise the legacy compiler, but that can be done in a separate PR. Make it clearer what's happening --- Rakefile | 62 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Rakefile b/Rakefile index 380e1da3..778ac8c0 100644 --- a/Rakefile +++ b/Rakefile @@ -2,11 +2,13 @@ # Rakefile for agent-payload # -protoc_binary="protoc" -protoc_version="3.5.1" +protoc_legacy_version="3.5.1" +protoc_legacy_binary="/tmp/protoc#{protoc_legacy_version}" + +protoc_version="21.12" +protoc_binary="/tmp/protoc#{protoc_version}" + gogo_dir="/tmp/gogo" -protoc_binary_2="protoc" -protoc_version_2="21.12" protoc_gen_go_dir="/tmp/protoc-gen-go" protoc_jsonschema_version="73d5723" @@ -14,38 +16,36 @@ protoc_jsonschema_version="73d5723" namespace :codegen do task :install_protoc do - if `bash -c "protoc --version"` != "libprotoc ${protoc_version}" - protoc_binary="/tmp/protoc#{protoc_version}" + if `bash -c "protoc --version"` != "libprotoc ${protoc_legacy_version}" sh <<-EOF /bin/bash <