Skip to content
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

Fix for protoc plugin extension reparse issue #3307

Merged
merged 6 commits into from
Sep 11, 2024

Conversation

jchadwick-buf
Copy link
Member

@jchadwick-buf jchadwick-buf commented Sep 9, 2024

This is a solution to the bug described in #3306. Paired with protoplugin changes that allow it, this ensures that gencode shipped with buf CLI does not interfere with the reparse process by prematurely resolving extensions to the gencode versions.

(Draft until protoplugin has an appropriate interface we can use upstream. This interim version uses a replace directive just to demonstrate that it does indeed fix the problem.)

protoplugin.Main(
protoplugin.HandlerFunc(handle),
protoplugin.WithUnmarshalOptions(proto.UnmarshalOptions{
Resolver: (*protoregistry.Types)(nil),
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand what this is doing and why - needs extensive code comments

Copy link
Member Author

Choose a reason for hiding this comment

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

The code has been made clearer, no more typed nil.

@jchadwick-buf jchadwick-buf marked this pull request as ready for review September 10, 2024 18:14
@bufdev bufdev changed the title Fix for protoc plugin extension reparse issue (Fixes #3306) Fix for protoc plugin extension reparse issue Sep 10, 2024
@doriable doriable self-requested a review September 10, 2024 19:18
Copy link
Member

@doriable doriable left a comment

Choose a reason for hiding this comment

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

Looks good to me, will defer to @bufdev for the final stamp.

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.

3 participants