ra1028 / DifferenceKit

💻 A fast and flexible O(n) difference algorithm framework for Swift collection.

Home Page:https://ra1028.github.io/DifferenceKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add prebuilt carthage framework

gotev opened this issue · comments

Checklist

Description

Add a prebuilt carthage framework to every DifferenceKit release to speed up build times when using it in apps.

Motivation and Context

I'm using carthage as dependency manager for my projects and I use DifferenceKit extensively, thank you for the awesome work! Carthage builds all the dependencies from source every time, unless they have a prebuilt framework attached to the github release. By attaching it, the client simply downloads the framework and build times are much faster.

Proposed Solution

## do this only the first time on your mac or CI
## https://github.com/github/hub
brew install hub

## to create a release, from the project's root
carthage build --archive
hub release create -a DifferenceKit.framework.zip -m "tag comment" "tag version"

And you will get a release like this (taken from RxSwift)
Schermata 2019-05-10 alle 11 44 06

Hi @gotev ,
Thanks for the proposal.

I currently have no motivation for this for three reasons.

  1. Apple hasn't yet shipped Swift's module stability. It may cause confusion for users who don't use compatible compiler versions.
  2. In most cases, you can reduce build time significantly using --cache-builds option.
  3. I don't know how to attach binaries with ensuring safety for security.

Hi @ra1028 !

For the first point, Carthage deals with that, ensuring all the frameworks are built with the same swift version. If a binary framework is not built with the same swift version, it automatically falls back to building it from source. For 2 definitely yes, and I use it a lot. For 3 it depends on how many people have access to your repository to publish releases. If you are the only one, then you're safe.

@gotev

The number of people currently accessible isn't the problem, IMHO.
I'm concerned that there is no way to verify that a binary is safe.
I don't want to publish prebuilt framework at present because of the evolution of SwiftPM announced by Apple at WWDC 2019.
Do I make sense?

@ra1028 it's OT here, but thanks to your library my code looks similar to what SwiftUI has brought to the table. Outstanding!

Regarding security, when I publish prebuilt frameworks today I use GitHub hub from CI, which uses safe authentication mechanism to deploy the framework, so I personally feel safe deploying like that, but this is your library, so I respect your point of view and your way of doing things, and if you don't intend publishing anything binary until new SPM comes out, that's perfectly reasonable.

@gotev

Thanks for your understanding.
TBH, I hope to abolish the support for package managers other than SwiftPM in the future.
I understand the convenience of the prebuilt binary, and the distribution as XCFrameworks is one possibility then.

TBH I hope once SPM is out, nobody else still uses Carthage or CocoaPods so we can all safely use a single official package manager.