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

Ability to checkout only specific type of Moya via Carthage #345

Closed
Austinate opened this Issue Dec 15, 2015 · 8 comments

Comments

Projects
None yet
5 participants
@Austinate
Contributor

Austinate commented Dec 15, 2015

Similar to way it's done via CocoaPods where podspec contains different types(Core/Rx/Reactive).

Right now when we pull Moya via Carthage — all 3 versions are downloaded and compiled (as well as specific dependencies for each one).
Obviously, that is much more time-consuming than pulling only 1 version.
Example: carthage update --platform tvos 856.54s user 145.58s system 445% cpu 3:44.89 total
And yup, i think this is not highest-priority thing because this is an issue mostly for first Carthage run with Moya at Cartfile.

I've checked Carthage and found zero answers about such possibility.

From all stuff i wrote above i have 3 different assumptions:

  • I'm wrong (feel free to tell me)
  • This is an issue and Carthage actually has way to solve this
  • This is an issue and Carthage has no ways to solve this (probably i'll create an issue on it's repo than).

I had a thought about dealing with that via

  • Tags
  • Separate branches (seems to be painful to support)

But i just hope to get any advice before starting to dig into that without even knowing if it's reasonable to spend time on this.

Thanks for attention :)

@petester42

This comment has been minimized.

Member

petester42 commented Dec 15, 2015

Sadly there is not notion of sub-libraries for Carthage so we can't do the same thing as cocoapods. There is, as far as I know, no way around not building all schemes in a project with Carthage. The solutions you bring up do work but as you indicated they are not ideal.

It is time consuming to build but you can version control it to not have to build it everytime you checkout your repo.

@Austinate

This comment has been minimized.

Contributor

Austinate commented Dec 22, 2015

😞 Thanks, hope it will get better soon.

@Austinate Austinate closed this Dec 22, 2015

@crenwick

This comment has been minimized.

crenwick commented Feb 12, 2016

Hey @petester42 -- curious if this could be re-evaluated (though not opening a new issue for it).

I understand that carthage has submodule limitations, but my last carthage bootstrap --platform iOS build took 15m11.546s as it built schemes for:

  • Alamofire iOS
  • RxBlocking-iOS
  • RxTests-iOS
  • RxCocoa-iOS
  • RxSwift-iOS
  • Moya iOS
  • ReactiveMoya iOS

but, as our app only uses vanilla Moya, we only needed to build schemes for:

  • Alamofire iOS
  • Moya iOS

and I imagine skipping the other 5 frameworks would reduce this time significantly.

Adding version control to not build is only a work around for carthage update (and, not ideal to ignore on our repo).
So version control or not, a 15 minute build time makes Fastlane completely unusable on dev machines, as it doesn't use carthage update to build.

I have yet to play around with forks, but is there still no solution to this? Would removing ReactiveCocoa/ReactiveCocoa and ReactiveX/RxSwift from the Cartfile (and letting users add them when they need it) completely break the vanilla build?

I'd love more insight on this, and to be able to help out with finding a solution. Otherwise, our alternative is either managing a private fork of Moya, or dropping it entirely (as Pods is not a technical option for this app).

@petester42

This comment has been minimized.

Member

petester42 commented Feb 12, 2016

Sadly there is no way to build only certain targets using Carthage. You could just do carthage checkout and manually link your dependencies. This is what reactive cocoa does for their project I believe. Might reduce build times.

Why are pods not an option? (Just curious)

@petester42

This comment has been minimized.

Member

petester42 commented Feb 12, 2016

The only "real" fix for this is to have separate repos but we decided to not go that way in the past since it adds a lot of complexity for 2 extra files.

@ashfurrow

This comment has been minimized.

Member

ashfurrow commented Feb 12, 2016

Correct – we tried multiple repos but it got out of hand, quickly. Moya was created as a CocoaPod, and the Carthage support we have today was added after the fact by volunteer contributors (we're very grateful). The Carthage team has been asked for a subspec-like feature to accommodate this, but they have decline (it's antithetical to how they believe libraries should be built).

@crenwick

This comment has been minimized.

crenwick commented Feb 12, 2016

Yeah -- multiple repos is way out of the question.

Thanks for the quick responses, y'all. You're all a super friendly and
helpful bunch :)

I'll be looking at other ways to bring moya in before going with more
drastic measures.

And we can't use pods with any swift libraries at the moment. We have a
required dependency that's very pick with who it plays with. Though, moving
that around might be a solution we will look more into.
On Fri, Feb 12, 2016 at 4:30 PM Ash Furrow notifications@github.com wrote:

Correct – we tried multiple repos but it got out of hand, quickly. Moya
was created as a CocoaPod, and the Carthage support we have today was added
after the fact by volunteer contributors (we're very grateful). The
Carthage team has been asked for a subspec-like feature to accommodate
this, but they have decline (it's antithetical to how they believe
libraries should be built).


Reply to this email directly or view it on GitHub
#345 (comment).

@ashfurrow

This comment has been minimized.

Member

ashfurrow commented Feb 12, 2016

Totally – everyone has different needs :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment