-
Notifications
You must be signed in to change notification settings - Fork 420
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
Carthage Support #13
Comments
Noted - thanks! |
Any insight into how to do this would be greatly appreciated -- currently having lots of trouble trying to use this library from an iOS application. |
@timburks @soffes Cartfile
and execute Adding Header Search Paths for CgRPC
Link Binary With Libraries PhaseRun Script PhaseCheck this out If you are interested. |
But there is no mac target though:
|
@ebriney Or Try this https://github.com/noppoMan/grpc-swift |
Thanks, I will try that. |
@noppoMan Thanks for your fork - I'm using it and it's very easy to get going thanks to the Carthage support! Cheers |
@noppoMan: it seems @timburks showed interest. Therefore, would it make sense to create a PR with the |
@noppoMan Thank you.
execute |
@timburks any update on this? It would help immensely for developing iOS apps |
I would love to see Carthage support for |
@timburks We got a working fork for Carthage, but that implies some changes if we want the main repository https://github.com/grpc/grpc-swift to support Carthage. I don't know what's your position about supporting Carthage but I'd strongly encourage to enable it (more adoption of |
Would another option be to simply avoid including zlib in your Carthage spec? For example, in my grpc-swift Podspec I include the necessary dependencies as other Pods instead of using any of the SPM packages or the vendored code. Given that zlib should be available on the Carthage-supported platforms anyway, maybe that would be another option? Actually, thinking more about this, is the zlib dependency still needed at all? With a cursory look through the framework, I can't find any code dependencies on zlib. |
If we can confirm that |
@SebastianThiebaud check out https://github.com/noppoMan/grpc-swift Using this fork, i was able to get grpc-swift to compile using Carthage |
@MikeSilvis This repo isn't having the latest changes for almost a year. I'm talking about having the official repository supporting Carthage. Like my initial message mentions, I already got a personal fork working with Carthage. |
Yes, i'm just confused as to what the blocker with |
My point is that the |
@SebastianThiebaud i highly suggest you checkout my fork and try using it with Carthage. I have |
Yes, I saw that you're using |
I have Carthage working, not Cocoapods |
Did anyone try just removing |
@SebastianThiebaud see #139. No mention of |
Good to know @MrMage. I will try something a bit later today then. |
@MrMage I just updated the |
Damn. Could you try using the system-provided zlib copy, though? (Linked with -lz) |
I will try this. Another limitation I just remembered: the way libs files (CgRPC, BoringSSL...) are included in the Xcode project is hard to maintain. |
@MrMage @SebastianThiebaud any update on this? I see that Cocoapods support was added |
I have a commit that removes the vendored zlib code (Timing-GmbH@263e66b). However, I don't use Carthage, so no idea what else would need to be done to get this usable for Carthage. |
I'm tired of the manual tinkering - so I just swapped back to cocoapods. Not my preference, but I find I have a lot more coding time as opposed to build time issues (and script failures) with Carthage. Waiting for Swift Package Manager once those lazy ass Apple guys do something about it for iOS. |
If you're interested, we're maintaining a branch for Carthage in a fork. https://github.com/postmates/grpc-swift/tree/carthage_structure We've also updated the |
Interesting! Do you think there would be a way to merge this upstream to give users the choice between CocoaPods and Carthage? |
I don't see any way to support Carthage if we don't commit the |
Does Carthage offer a "pre-build" step? In that case, could we have a "pre-build" script that has SPM generate the project on the fly and, if necessary, patches in the necessary scheme files? |
I wish, but it doesn't 😞 |
Why is it not possible to support both the |
At that point we'd need to ensure that the Carthage |
Right, I played a bit more with it, and it is not so straightforward. Especially because I am building for iOS. So I'll give up on Carthage for now. |
What extra complications does building for iOS cause in this case? We are interested in improving the developer experience using SwiftGRPC on iOS, so maybe there are some thing we can improve on here. |
I have, I believe, two main issues for Carthage (note: I am on tag 0.4.2).
I read a lot on the Carthage issues/discussions, and I don't believe they would be open to add a possibility to have a "prebuild script" (in this case And more importantly, I don't think Carthage is planning to add a way to select which targets to build. There have been many discussions, people have been wanting that for years, have been arguing and all, so I would not count on that anytime soon. It feels like Carthage works well when you have an |
Thanks for the elaboration! As I mentioned before, I might be okay with maintaining a versioned variant of the |
Yeah but at some point, if Carthage requires hacks everywhere in the project, I am not sure if it is really worth it. For instance, what are "non-Carthage" targets? Maybe people actually want to build all targets for macOS, and only iOS depends solely on |
I think the things that need to built for Carthage are identical on iOS and Mac (the ones you named). For the rest, we can keep asking users to clone the repo separately and use SPM. With CocoaPods, they also need to clone the repo and build the Depends on how many hacks would be needed to make the Carthage project work, of course. My stance is more like "If a Carthage users wants this so badly that they would build it the way I described above, then we can probably accomodate for it". I'm not going to go out and build it for them right now ;-) |
I believe this issue can be closed now! :-) |
Well, actually it doesn't work (see here) 😞. It works for the simulator, but there seems to be a signing problem somewhere that I don't understand. |
I was not using Carthage's Here is an example project that works with grpc-swift! I also have 2 other projects where people have been able to use the Carthage integration, so I would say it is finally working 🎉. |
Sorry, is this still working? ;-) I noticed some changes between "working" and "not working"; please let me know if everything is working now and whether we need to update some code or documentation on the SwiftGRPC side for full Carthage compatibility. |
It is working. I thought it was not, but it was my fault as a Carthage user, and not a bug in the SwiftGRPC setup. And now I have other developers who have been using it in other projects and who confirmed that it works for them :-). |
Thanks for the heads-up! Closing this; let me know (or file a new issue) in case you do encounter problems in the future. |
Contains the following commits: - Refactor gRPC decoding into dedicated codec classes. - Start work on GRPCServerHandler. - Add a "unary call handler" and use that for the tests. - Refactoring starting a GRPC server into a dedicated class. - Fix sending unary responses. - Add a handler for client-streaming calls. - Also implement bidirectional-streaming calls. - Make sure to flush in server-streaming calls after each sent message. - Add the missing test cases to `allTests`. - Refactor `StatusSendingHandler` into its own class. - Rename `GRPCServerHandler` to `GRPCChannelHandler`. - Remove a FIXME. - Add a few more comments. - Attach the actual call handlers as channel handlers instead of manually forwarding messages to them. # This is the commit message grpc#2: Remove SwiftGRPCNIO's dependency on SwiftGRPC and move the responsibility for encoding GRPC statuses to HTTP1ToRawGRPCServerCoded. # This is the commit message grpc#3: Temporarily disable two test cases that are failing at the moment. # This is the commit message grpc#4: Add SwiftGRPCNIO as an exposed library. # This is the commit message grpc#5: Another try at getting CI to work with SwiftGRPCNIO. # This is the commit message grpc#6: More dependency fixes. # This is the commit message grpc#7: Add `SwiftGRPCNIO.EchoServerTests` to LinuxMain.swift. # This is the commit message grpc#8: Fix a string comparison in `.travis-install.sh`. # This is the commit message grpc#9: Add nghttp2 to the list of CI dependencies. # This is the commit message grpc#10: Another try with installing nghttp2 via brew. # This is the commit message grpc#11: Another try at using libnghttp2-dev under Ubuntu 14.04. # This is the commit message grpc#12: More Travis fixes. # This is the commit message grpc#13: One last try. # This is the commit message grpc#2: Disable two more tests for now, as they sometimes fail on CI. # This is the commit message grpc#3: Make Carthage debug builds verbose. # This is the commit message grpc#4: Only use SwiftGRPC-Carthage.xcodeproj for Carthage builds.
Is this task resolved and is Carthage officially supported now? Not able to get this to build using Carthage: |
@sbarow: Are you on Xcode 10? Somehow it doesn't build with Xcode 10, and I haven't understood why yet. Xcode 9.4.1 works, though. I'm not sure what Xcode 10 is doing but it somehow changes the |
@JonasVautherin could it be that the paths generated by `swift resolve` are different for Xcode 10 vs. 9.4? Or maybe Xcode 10/Swift 4.2 simply doesn't generate deterministic paths for the dependencies, while 9.4/Swift 4.1 does? That would also explain why I never was able to create a working Carthage project for the NIO branch.
… On 7. Nov 2018, at 19:12, Jonas Vautherin ***@***.***> wrote:
@sbarow: Are you on Xcode 10?
Somehow it doesn't build with Xcode 10, and I haven't understood why yet. Xcode 9.4.1 works, though. I'm not sure what Xcode 10 is doing but it somehow changes the path = ".build/checkouts/swift-protobuf.git-<hash> in the project file and then doesn't find it -_-.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
It would be fantastic if you had Carthage support with pre-built binaries ❤️
The text was updated successfully, but these errors were encountered: