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

objective-c: invalid readme or pathing error #482

Closed
oddanderson opened this issue Jun 9, 2015 · 8 comments
Closed

objective-c: invalid readme or pathing error #482

oddanderson opened this issue Jun 9, 2015 · 8 comments

Comments

@oddanderson
Copy link

The instructions say to include all objectivec/.h files and the .m files, however some files reference google/protobuf/.objc.h files which means they need to be included as well. In addition, the google/protobuf/*.objc.h/m files all use relative pathing for their import statements, which is a problem. Relative pathing should be avoided as much as possible with open-source objc files.

@thomasvl
Copy link
Contributor

What's the problem with relative paths? Basically all includes are relative paths (they are done off the header search path). Yes, the common case is that they don't have a directory in the #include/import statement, but they are still relative. :)

@oddanderson
Copy link
Author

I don't even have the code for this project anymore as I moved on from protobufs. But here's the scenario:

Create a project that uses protobufs. Then make that project open-source and create a cocoapod for it. If another project tries to use this cocoapod, it will fail to compile. The protobuf source files are located in a different directory under a different directory scheme than the original project via cocoapods, which is why it won't work.

@thomasvl
Copy link
Contributor

@jcanizales

You seen any problems with this with cocoapods?

@thomasvl
Copy link
Contributor

It almost sounds like the problem might be transitive include paths. i.e. if the project you make (that uses protos) is exposing protos via their headers; in which case, my guess would be the problem could be how that other project sets up it's pod to properly cascade the header dependency.

@jcanizales
Copy link
Contributor

Create a project that uses protobufs. Then make that project open-source and create a cocoapod for it. If another project tries to use this cocoapod, it will fail to compile.

gRPC is an example of such project, that compiles alright, except for one specific scenario that might be what @oddanderson encountered. This is when Cocoapods is asked to generate the libraries as dynamic frameworks (instead of static libraries). This is necessary when one also uses pods written in Swift.

In that case Cocoapods does some things that don't work for a project that has headers in subdirectories, so I filed CocoaPods/CocoaPods#4605 . One of the gRPC users and I investigated it together and found a fix, but I haven't gotten the time to create a patch for Cocoapods. Nor have I tested any of it for Cocoapods 1.0.0-beta-3 (only 0.39).

@thomasvl
Copy link
Contributor

Does this end up being the same root problem as we've been looking at with #1457?

@jcanizales
Copy link
Contributor

That's what I referred to when I made my comment. I would think that's the problem Todd was facing.

@thomasvl
Copy link
Contributor

Ok, then I'll close this as hopefully PR #1593 fixed it.

taoso pushed a commit to taoso/protobuf that referenced this issue Aug 1, 2018
There is an internal type to Google called RawMessage that is similar
to json.RawMessage. Since there is no proper proto reflection API,
we special-cased the Bytes method of RawMessage to access the raw bytes.
This is a gross hack since Bytes() []byte is such a common method signature.

Remove this hack.

Fixes protocolbuffers#311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants