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

Objc update WKT generated import paths. #23228

Merged
merged 1 commit into from Jun 18, 2020

Conversation

yulin-liang
Copy link
Contributor

@yulin-liang yulin-liang commented Jun 16, 2020

Works around #23195

Generated reference to the WellKnownTypes (WKTs) bundled with the ObjC Protobuf library has been changed(protocolbuffers/protobuf#7173). Updates their import paths.

@@ -52,15 +52,16 @@ inline ::grpc::string ImportProtoHeaders(

::grpc::string base_name = header;
grpc_generator::StripPrefix(&base_name, "google/protobuf/");
::grpc::string file_name = "GPB" + base_name;
Copy link
Member

@muxi muxi Jun 17, 2020

Choose a reason for hiding this comment

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

@ thomasvl - could you confirm that your change in protobuf follows the pattern of 1) moving WKT files from objectivec/google/protobuf/ to objectivec/ and 2) add GPB prefix to the headers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've already check with Thomas, we just need to update paths from objectivec/google/protobuf/to objectivec/ and add GPB prefix to the headers.

He mentioned that we also need to set the min version of protobuf to the release(v3.12.0) where they shipped this. I've check !ProtoCompiler.podspec, the version is 3.12.2, looks like we don't need to change it.

@@ -52,15 +52,16 @@ inline ::grpc::string ImportProtoHeaders(

::grpc::string base_name = header;
grpc_generator::StripPrefix(&base_name, "google/protobuf/");
Copy link
Member

@muxi muxi Jun 17, 2020

Choose a reason for hiding this comment

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

I am thinking that if protobuf moved things out of google/protobuf, users should probably not continue to use google/protobuf prefix in their #import statement? That sounds like a breaking change though so I'm not sure if that's true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They only changed paths of .pbobjc.h/m files. For .proto files, their paths are still the same. The header variable is generated based on these .proto files, so we still need to strip google/protobuf prefix.

Copy link
Member

Choose a reason for hiding this comment

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

Ah that makes sense!

@yulin-liang yulin-liang merged commit 80288ae into grpc:master Jun 18, 2020
@yulin-liang yulin-liang deleted the protobuf_path branch June 18, 2020 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/ObjC platform/iOS release notes: no Indicates if PR should not be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants