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

[WIP] Add support for Carthage through xcodegen #336

Closed
wants to merge 1 commit into from

Conversation

JonasVautherin
Copy link
Contributor

Trying to implement a solution for #329.

FYI: @MrMage, @sbarow, @ishkawa

I get an error saying:

Showing All Messages
:-1: Multiple commands produce '/Users/jones/Library/Developer/Xcode/DerivedData/SwiftGRPC-XcodeGen-gohnuovawbgognemswwzuzdzqfeh/Build/Products/Debug-iphonesimulator/BoringSSL.framework/Headers/internal.h':
1) Target 'BoringSSL_iOS' (project 'SwiftGRPC-XcodeGen') has copy command from '/tmp/test_xcodegen/grpc-swift/Sources/BoringSSL/crypto/bio/internal.h' to '/Users/jones/Library/Developer/Xcode/DerivedData/SwiftGRPC-XcodeGen-gohnuovawbgognemswwzuzdzqfeh/Build/Products/Debug-iphonesimulator/BoringSSL.framework/Headers/internal.h'
2) Target 'BoringSSL_iOS' (project 'SwiftGRPC-XcodeGen') has copy command from '/tmp/test_xcodegen/grpc-swift/Sources/BoringSSL/crypto/bytestring/internal.h' to '/Users/jones/Library/Developer/Xcode/DerivedData/SwiftGRPC-XcodeGen-gohnuovawbgognemswwzuzdzqfeh/Build/Products/Debug-iphonesimulator/BoringSSL.framework/Headers/internal.h'
...
[and a lot more similar ones]

I'm stuck there, I have absolutely no idea what's happening.

@MrMage
Copy link
Collaborator

MrMage commented Nov 21, 2018

Thank you! Could you please also add tooling to generate the Xcode project? Also, I assume the Carthage project will also need to be committed?

In terms of the error, my suspicion would be that those internal headers should not be marked "public" to avoid duplicating them. I think this is one of the reasons why the BoringSSL Podspec is fairly elaborate.

project.yml Outdated Show resolved Hide resolved
@JonasVautherin
Copy link
Contributor Author

Thanks a lot, now BoringSSL builds! Moving to CgRPC, I get the following errors:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:70:9: error: no member named 'memcpy' in the global namespace
using ::memcpy;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:71:9: error: no member named 'memmove' in the global namespace
using ::memmove;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:72:9: error: no member named 'strcpy' in the global namespace
using ::strcpy;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:73:9: error: no member named 'strncpy' in the global namespace
using ::strncpy;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:74:9: error: no member named 'strcat' in the global namespace
using ::strcat;
      ~~^
...
[and a lot of similar ones]

Any idea?

@JonasVautherin
Copy link
Contributor Author

Some progress here for CgRPC:

  • All the headers should apparently not go in the "project" section of the "Headers build phase"
  • cgrpc.h should go in the "public" section of the "Headers build phase"
  • In "Compile Sources" (still "Build Phases"), the files appear twice: once from Source/cgrpc/include/src, and once from Sources/cgrpc/src, resulting in "duplicated symbol" errors. I guess the includes should be excluded from "Compile Sources"
  • libz should apparently be linked

@sbarow: I am trying to do that in the project.yml, but I'm not very successful so far. So I'm open to suggestions :-)

@JonasVautherin
Copy link
Contributor Author

JonasVautherin commented Nov 21, 2018

Well, I'm lost. I don't know why I can't make CgRPC build, I don't know if xcodegen can do what I need at all, I spent way too much time on that and I'm fed up.

Just for the record before I give up: I tried to make xcodegen generate the same Build Phases as my previous solution with make project-carthage with:

sources:
      - path: Sources/CgRPC/include/cgrpc.h
        buildPhase: headers
        headerVisibility: public
      - path: Sources/CgRPC/shim
        excludes:
          - "*.h"
        buildPhase: sources
      - path: Sources/CgRPC/src
        excludes:
          - "*.h"
        buildPhase: sources

But it doesn't do what I want at all, it seems like xcodegen doesn't have recursive matching capabilities and I'm not even sure I am going in the right direction.

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

Successfully merging this pull request may close these issues.

3 participants