Skip to content

Allow FileDescriptors to be parsed with extension registries#8220

Merged
jtattermusch merged 2 commits intoprotocolbuffers:masterfrom
jskeet:bytestrings-with-extensions
Feb 1, 2021
Merged

Allow FileDescriptors to be parsed with extension registries#8220
jtattermusch merged 2 commits intoprotocolbuffers:masterfrom
jskeet:bytestrings-with-extensions

Conversation

@jskeet
Copy link
Contributor

@jskeet jskeet commented Jan 20, 2021

This allows for much cleaner handling of extensions in dynamic environments such as when writing a protoc plugin.

This is important when parsing descriptor sets that contain extensions.
(The alternative is to get the descriptor bytes again for individual
elements, e.g. message descriptors, and reparse them with the
appropriate extensions. It's really ugly.)
@jskeet
Copy link
Contributor Author

jskeet commented Jan 20, 2021

(First commit is from #8219.)

@jskeet jskeet added the c# label Jan 20, 2021
Copy link
Contributor

@jtattermusch jtattermusch left a comment

Choose a reason for hiding this comment

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

LGTM, but wondering what the immediate use is. Are you planning to write a protoc plugin in pure C#?

@jskeet
Copy link
Contributor Author

jskeet commented Jan 29, 2021

We already have a protoc plugin in pure C#: https://github.com/googleapis/gapic-generator-csharp
It requires some annoying hackery to get at the options.

Additionally, we're working on an "API index" which will parse protobuf descriptor sets for protos in https://github.com/googleapis/googleapis
Both of these will be simpler when this is merged :)

@SNiTEBoBy
Copy link

#8220
Reviews and change

@jtattermusch
Copy link
Contributor

We already have a protoc plugin in pure C#: https://github.com/googleapis/gapic-generator-csharp
It requires some annoying hackery to get at the options.

Ah, nice, I did not realize that.

Additionally, we're working on an "API index" which will parse protobuf descriptor sets for protos in https://github.com/googleapis/googleapis
Both of these will be simpler when this is merged :)

SG!

@jtattermusch
Copy link
Contributor

I looked at the test failures and they seem unrelated. The Windows C# failure also exists on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants