-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retain custom options as known fields, even with custom `descriptor.p…
…roto` (#109) An issue was introduced in #97 -- if a custom `descriptor.proto` is used, then custom options may come across in the final compilation result as unrecognized fields. The first commit in this PR is a repro case. This happens when the options in question come from _public_ imports and when an _override_ set of options are used. We have to use a dynamic message to represent the override definition of the options. But the result ultimately needs to be the generated type (not a dynamic message). So we end serializing the dynamic message to bytes and then de-serializing that into the generated type. During de-serialization, we were supplying an extension resolver that was failing to find the custom option, because it was visible via a public import. To fix the issue, I found several code paths that could be unified and consolidated, which ultimately resulted in removing a few no-longer-used methods from interfaces defined in the linker sub-package. This also changes the way we handle an override descriptor.proto by making it an interpreter option instead of providing it during linking (since it is really only used by the option interpreter). These API/interface changes are not technically backwards compatible. But this repo is still pre-v1.0, and these changes are in interfaces that we don't actually expect any users to implement.
- Loading branch information
Showing
9 changed files
with
325 additions
and
256 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.