Skip to content

Update protoc to v22.0#100

Merged
jhump merged 5 commits intomainfrom
jh/protoc-v22
Mar 2, 2023
Merged

Update protoc to v22.0#100
jhump merged 5 commits intomainfrom
jh/protoc-v22

Conversation

@jhump
Copy link
Member

@jhump jhump commented Mar 1, 2023

This repo uses protoc for verification -- to make sure that things like options interpretation and source code info match what the reference compiler produces.

This updates the version of protoc used to the latest release v22.0. This uncovered discrepancies: changes/fixes in protoc that required changes to protocompile code to match.

  1. The first failing test to address was in the canonical output for options when an override version of descriptor.proto was in use. The new v22.0 compiler includes a new field on google.protobuf.EnumOptions with a tag of 6. It just so happens that the test's override version also had a field with a tag of 6. The new compiler's field is a bool, but the override version's is a string. Since these use incompatible wire type encoding, protoc treats the override field as an unrecognized field, despite it having a known tag. So I've updated the options interpretation code to implement the same logic.
  2. The next set of tests to address were known changes coming in the new compiler: fixes to source code info. So the changes here address a couple of TODOs in the code. I've also added some more comments to a test file, to provide some more scenarios in which to verify that protocompile generates the same source code info as protoc.

@jhump jhump requested a review from pkwarren March 1, 2023 02:47
@jhump jhump enabled auto-merge (squash) March 2, 2023 17:31
@jhump jhump merged commit 5340254 into main Mar 2, 2023
@jhump jhump deleted the jh/protoc-v22 branch March 2, 2023 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants