PactSwift repository history purge July 2024 #122
Replies: 1 comment
-
UPDATE: Due to lack of time, this action is pushed out by 2 weeks. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR
Warning
PactSwift
project's history will be rewritten and old commits and releases up to latest will be purged.PactSwift
and dependent repositories will be reduced.Context
Due to the nature of this project and various attempts of sharing incredibly oversized
libpact_ffi
binaries this repository has grown in size to a level where it is no longer maintainable. Using binaries built from Rust code allows us to keep the same implementation of Pact specification across different platforms.Relying on binaries however requires us to keep each of the releases and attempts to test changes where binaries were only slightly modified committed into the repository making the repository unnecessarily big.
PactSwift
also aims to support bothx86_64
andarm64
platforms for simulators and physical devices (with caveats).libpact_ffi
binaries need to be compiled fromrust
code for each of the platforms and targets. That means each of the binaries must contain runtimes so thatPactSwift
users do not need to install and configure rust on their development and CI machines, and can run on a physical device. Unfortunately, this means that binaries end up being "fat binaries" containing code for their specific architectures.Example sizes of
libpact_ffi
binaries:With the above being configured in a way that
PactSwift
users only need to worry about#import PactSwift
, that means all those MBs need committed into the repository and they are pulled onto developers' machines. Imagine the size of all the versions of those binaries being committed into the repository.The big size of
PactSwift
along with the size of PactSwiftMockServer dependency can be detrimental to developer experience, development machines, CI agents, network bandwidth allowance, etc. It blew up to multiple GBs!Unfortunately Swift Package Manager clones the entire repository instead of just doing a shallow clone. This means that all the machines in the world cloning this repository (including CI agents) need to pull GBs worth of data every time they trigger resolve dependencies command.
PactSwift used to actively support Carthage as well. Using Carthage suffers from the same issue of cloning the entire repository. Additionally, Carthage seems to be dropping transient dependencies and so the Carthage support was gradually ignored.
This is a non-sponsored Open Source project and there is no intention to pay for GitHub LFS nor bandwidth needed to transfer all this data most of which is useless.
Tip
More information about what
libpact_ffi
is can be found here.Alternatives
Building binary dependencies on developers' machines
It would be possible to reduce the size of this project by pushing the responsibility for sourcing
libpact_ffi
binaries to users of this framework.This could be either by:
Both of these have been tried and tested and proven to itroduce a barrier to adoption.
XCFrameworks
XCFrameworks were introduced to
PactSwift
its dependencies as they have proven to strip the binaries down to the size below 100MB in some cases. Yet they still wrapped at least 3 making each new release containing changes tolibpact_ffi
blow up by another 300MB or so.Despite that, XCFrameworks remain the most appropriate way to share binary targets.
Example sizes of
libpact_ffi
binaries in XCFramework:These sizes are much more palatable being ~52% of their original size, yet still extremely big to keep them all in same repo or shared as a non-compressed dependency!
Decision
Caution
compatibility/vX.Y.Z
- containing the code > supporting Objective-C and Linux.PactSwiftMockServer
repository will only be responsible to maintain the wrapper code aroundlibpact_ffi
and generate > rust binaries.PactSwiftMockServer
will be converted into XCFramework.PactSwift
will be set to point at a ZIP archive (see more).PactSwfit
will shift its main focus to support modern swift concurrency.Consequences
PactSwift
repository will experience issues trying to sync with original repository.Resources
Beta Was this translation helpful? Give feedback.
All reactions