grpc-swift: Carthage not working for 0.5.1 & 0.6.0

Carthage: 0.31.2 Tried with: github "grpc/grpc-swift" "23a0ebdee9613f615f2f2469ed3e700df5856417" github "grpc/grpc-swift" "0.6.0" github "grpc/grpc-swift" "0.5.1"

_Originally posted by @sbarow in https://github.com/grpc/grpc-swift/issues/13#issuecomment-436341804_

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 43 (17 by maintainers)

Most upvoted comments

I have started working on an XcodeGen version. It will contain 3 targets BoringSSL, CgRPC, SwiftGRPC regarding SwiftProtobuf we will get with Carthage and add as a dependency in a Cartfile

I’ll try have a WIP diff up soon, getting the build settings correct for BoringSSL & CgRPC will be a bit tricky.

@MrMage side note, this issue might be of interest to watch Carthage: Add support for Swift Package Manager only projects

Hopefully fixed by #360; thanks to @byuarus and @JonasVautherin for making this happen!

@JonasVautherin I have been bogged down with stuff at work, I’ll only be able to look at this again next week.

Thanks for the heads-up! Please disregard my comment about BoringSSL; I forgot that we are shipping the source code of that in the repository. Sorry again! (I’ve only been able to use my phone for most of the past few days, so can’t look into the code too much.)

On 15. Nov 2018, at 07:56, Cameron Mc Gorian notifications@github.com wrote:

I have started working on an XcodeGen version. It will contain 3 targets BoringSSL, CgRPC, SwiftGRPC regarding SwiftProtobuf we will get with Carthage and add as a dependency in a Cartfile

I’ll try have a WIP diff up soon, getting the build settings correct for BoringSSL & CgRPC will be a bit tricky.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

@JonasVautherin

If I understand correctly, you suggest that the issue is coming from SwiftProtobuf. What if grpc-swift added more dependencies?

Same as SwiftProtobuf, because the issue is not SwiftProtobuf-specific. We can add a new dependency by following steps:

  1. Add a line to Cartfile.
  2. Modify patch-carthage-project.rb to add the new framework to xcworkspace.
  3. Run make project-carthage.

Thinking about it, why not just removing the SwiftPM dependencies and using a Cartfile for that?

Purpose of 3 and 4 in my previous comment are to let Xcode to know:

  • Path to frameworks to link.
  • Which build target to build before building SwiftGRPC.

Without the steps, xcodebuild run by Carthage will not build SwiftProtobuf.

Actually, it is a little bit complicated to generate xcodeproj compatible with Carthage. Especially, when a project has dependencies. With XcodeGen, we can do the same things in more straightforward way. It would be a good choice.

@JonasVautherin nice, I can take a look at the XcodeGen stuff if we are okay with doing that. Have been using it for a while on some projects.

(Sorry for spamming the issue, but I’ve got news):

From Aciid comment’s here, it sounds like it is a bad idea to generate the xcodeproj from SwiftPM for Carthage.

From stephencelis comment’s here, it seems like we could generate an xcode project using XcodeGen, and share that one on the repo. Which means that Cocoapods, Carthage and SwiftPM would be maintained separately, but it seems like it is the only truly correct way…

I don’t think so, as Swift modules are not yet ABI-stable. Also, we do not want to pollute the repository with build artifacts like that.