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
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR
Warning
PactSwiftproject's history will be rewritten and old commits and releases up to latest will be purged.PactSwiftand dependent repositories will be reduced.Context
Due to the nature of this project and various attempts of sharing incredibly oversized
libpact_ffibinaries 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.
PactSwiftalso aims to support bothx86_64andarm64platforms for simulators and physical devices (with caveats).libpact_ffibinaries need to be compiled fromrustcode for each of the platforms and targets. That means each of the binaries must contain runtimes so thatPactSwiftusers 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_ffibinaries:With the above being configured in a way that
PactSwiftusers 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
PactSwiftalong 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_ffiis 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_ffibinaries 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
PactSwiftits 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_ffiblow up by another 300MB or so.Despite that, XCFrameworks remain the most appropriate way to share binary targets.
Example sizes of
libpact_ffibinaries 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.PactSwiftMockServerrepository will only be responsible to maintain the wrapper code aroundlibpact_ffiand generate > rust binaries.PactSwiftMockServerwill be converted into XCFramework.PactSwiftwill be set to point at a ZIP archive (see more).PactSwfitwill shift its main focus to support modern swift concurrency.Consequences
PactSwiftrepository will experience issues trying to sync with original repository.Resources
Beta Was this translation helpful? Give feedback.
All reactions