Conversation
pkwarren
reviewed
Apr 18, 2024
pkwarren
approved these changes
Apr 19, 2024
kralicky
pushed a commit
to kralicky/protocompile
that referenced
this pull request
May 19, 2024
… can't support them (bufbuild#284) The protobuf-go runtime currently only supports message set wire format when built with the `protolegacy` build tag. Most users don't use this tag, but protocompile allows sources to be processed that define messages with this legacy feature. The problem arises if a custom option refers to such a message: in that case, the resulting descriptors returned by protocompile will not be serializable. Since the protobuf-go runtime doesn't support message set wire format, it will serialize the options as if they were normal wire format messages, which will be incorrect. So this module now checks if the protobuf-go dependency supports message set wire format (by trying to create a very simple file descriptor that uses it). If it does not, it will report an error when interpreting options if any option tries to use message set wire format. (cherry picked from commit 5fa4f14)
kralicky
pushed a commit
to kralicky/protocompile
that referenced
this pull request
Jun 8, 2024
… can't support them (bufbuild#284) The protobuf-go runtime currently only supports message set wire format when built with the `protolegacy` build tag. Most users don't use this tag, but protocompile allows sources to be processed that define messages with this legacy feature. The problem arises if a custom option refers to such a message: in that case, the resulting descriptors returned by protocompile will not be serializable. Since the protobuf-go runtime doesn't support message set wire format, it will serialize the options as if they were normal wire format messages, which will be incorrect. So this module now checks if the protobuf-go dependency supports message set wire format (by trying to create a very simple file descriptor that uses it). If it does not, it will report an error when interpreting options if any option tries to use message set wire format. (cherry picked from commit 5fa4f14)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The protobuf-go runtime currently only supports message set wire format when built with the
protolegacybuild tag. Most users don't use this tag, but protocompile allows sources to be processed that define messages with this legacy feature.The problem arises if a custom option refers to such a message: in that case, the resulting descriptors returned by protocompile will not be serializable. Since the protobuf-go runtime doesn't support message set wire format, it will serialize the options as if they were normal wire format messages, which will be incorrect.
So this module now checks, at init time, if the protobuf-go dependency supports message set wire format (by trying to create a very simple file descriptor that uses it). If it does not, it will report an error when interpreting options if any option tries to use message set wire format.