Skip to content

Bump protoc version to 3.21.3 #673

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

Merged
merged 1 commit into from
Jul 26, 2022
Merged

Conversation

seaneganx
Copy link
Contributor

No description provided.

@seaneganx seaneganx requested a review from theganyo July 25, 2022 21:45
@codecov
Copy link

codecov bot commented Jul 25, 2022

Codecov Report

Merging #673 (d05bcc0) into main (9bf1213) will not change coverage.
The diff coverage is n/a.

❗ Current head d05bcc0 differs from pull request most recent head c692ad4. Consider uploading reports for the commit c692ad4 to get more accurate results

@@           Coverage Diff           @@
##             main     #673   +/-   ##
=======================================
  Coverage   54.09%   54.09%           
=======================================
  Files          78       78           
  Lines        7326     7326           
=======================================
  Hits         3963     3963           
  Misses       2940     2940           
  Partials      423      423           

Help us with your feedback. Take ten seconds to tell us how you rate us.

@@ -51,7 +51,7 @@ function clone_common_protos {
# Require a specific version of protoc for generating files.
# This stabilizes the generated file output, which includes the protoc version.
. tools/PROTOC-VERSION.sh
if [ "$(protoc --version)" != "libprotoc $PROTOC_VERSION" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is odd. Why is the 3. separately hard-coded from the rest of the version now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because https://github.com/protocolbuffers/protobuf/releases doesn't include the major version in the asset names anymore, but the output from protoc --version still includes it.

We use the $PROTOC_VERSION variable to build the asset URL.

export SOURCE="https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-$ARCH.zip"
echo $SOURCE
curl -L $SOURCE > /tmp/protoc.zip
unzip /tmp/protoc.zip -d /usr/local

Hardcoding the 3. in our version checks is easier than trimming it from the variable before building that URL.

Copy link
Member

@theganyo theganyo Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Their strategy is confusing to me... It sounds like they are still doing major version releases on a per-language basis: https://developers.google.com/protocol-buffers/docs/news/2022-05-06. And, if you look at the tags, they are still tagging (if not creating "releases") that match the full major versioning scheme: https://github.com/protocolbuffers/protobuf/tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm confused too. I just know that when I bumped the version like we always have, our FETCH-PROTOC.sh script started to fail (and caused CI failures). That led me to discover the new versioning scheme.

Looking at those release tags, we can see there is a tag for v3.21.4, but all the language-specific assets including the one we depend on are kept in the v21.4 tag.

I'm not really worried about this though. Our scripts will work as long as the tag we're pointing at remains stable. If they change the versioning scheme again for future releases we'll just need to adapt to that next time we bump our protoc version. At worst it's an annoyance every few months.

@seaneganx seaneganx merged commit dfc3189 into apigee:main Jul 26, 2022
@seaneganx seaneganx deleted the protoc-3.21.3 branch July 26, 2022 16:03
if [ "$(protoc --version)" != "libprotoc $PROTOC_VERSION" ]; then
echo "Please update your protoc to version $PROTOC_VERSION, the current required version as specified in tools/PROTOC_VERSION.sh"
if [ "$(protoc --version)" != "libprotoc 3.$PROTOC_VERSION" ]; then
echo "Please update your protoc to version 3.$PROTOC_VERSION, the current required version as specified in tools/PROTOC_VERSION.sh"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now it seems that "3" is the $GO_PROTOC_MAJOR_VERSION. Someday we might want to make that explicit instead of leaving the mysterious "3." around, which someone in the future might think is a typo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants