-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
[ObjC] Add support for using the proto package to prefix symbols. #8760
Merged
Conversation
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
dmaclach
approved these changes
Jun 23, 2021
src/google/protobuf/compiler/objectivec/objectivec_generator.cc
Outdated
Show resolved
Hide resolved
src/google/protobuf/compiler/objectivec/objectivec_generator.cc
Outdated
Show resolved
Hide resolved
dmaclach
approved these changes
Jun 24, 2021
src/google/protobuf/compiler/objectivec/objectivec_generator.cc
Outdated
Show resolved
Hide resolved
src/google/protobuf/compiler/objectivec/objectivec_generator.cc
Outdated
Show resolved
Hide resolved
src/google/protobuf/compiler/objectivec/objectivec_generator.cc
Outdated
Show resolved
Hide resolved
src/google/protobuf/compiler/objectivec/objectivec_generator.cc
Outdated
Show resolved
Hide resolved
This likely should have been the default from the start, as without it is way to common to get symbol collisions between different proto files. It would be nice to support a "migration" mode where both names are created to aid it moving code to this model, but with ObjC `@class` decls being very common to avoid header imports to control rebuilds/etc., it doesn't work as an `@class` usage will error if one also uses `@compatibility_alias`. Falling back to `#define` the two together also doesn't work as the header with the `@class` will cause methods to get defined with one interface, but when methods taking those types are define will likely #import the generate header and thus get the define and end up with a different signature. So for now, there is no migration support and code has to be updated in one shot with enable the new prefixing. - Add a generation option to enable this change in generation. - Add a second generation option to provide a list of proto package that are exceptions from using the proto package. This allows easier migration/updating of code one package at a time.
veblush
pushed a commit
to grpc/grpc
that referenced
this pull request
Jul 14, 2021
This adds support for protobuf ObjC support for using the proto package to define the prefix for the file (protocolbuffers/protobuf#8760). Once protobuf cuts a release, it likely makes sense to support the same generator options that the objc generator does, but for now the environment variable support can used to enable this when building from recent sources.
lidizheng
pushed a commit
to lidizheng/grpc
that referenced
this pull request
Sep 23, 2021
This adds support for protobuf ObjC support for using the proto package to define the prefix for the file (protocolbuffers/protobuf#8760). Once protobuf cuts a release, it likely makes sense to support the same generator options that the objc generator does, but for now the environment variable support can used to enable this when building from recent sources.
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.
This likely should have been the default from the start, as without it is way to
common to get symbol collisions between different proto files. It would be nice
to support a "migration" mode where both names are created to aid it moving code
to this model, but with ObjC
@class
decls being very common to avoid headerimports to control rebuilds/etc., it doesn't work as an
@class
usage willerror if one also uses
@compatibility_alias
. Falling back to#define
the twotogether also doesn't work as the header with the
@class
will cause methods toget defined with one interface, but when methods taking those types are define
will likely #import the generate header and thus get the define and end up with
a different signature. So for now, there is no migration support and code has to
be updated in one shot with enable the new prefixing.
exceptions from using the proto package. This allows easier
migration/updating of code one package at a time.