[swift-build-dev] [swift-evolution] [Proposal] Applying local git patches

Max Howell max.howell at apple.com
Tue Jan 12 18:53:07 CST 2016


> Hello all,
> 
> I’d like to discuss the possibility of adding support for git patching packages.
> 
> This would solve the following problem:
> 
> You want to add library A to your project. It’s open source and mostly does what it says, but has a small bug. You fix the bug but the library’s developer is not responsive or doesn’t want to add the fix right away. Or, maybe you add a small modification to fit your requirements. Either case, you would like to have a way to apply your patch but also keep the original repo linked.
> 
> Both text (i.e. `empty_name.patch`) and local/remote url patches could be supported. For the urls, they could be contained in the package manifest. The files could follow the directory naming convention (maybe `Patches`?)
> 
> The only way I can think of achieving something similar would be to separately clone project A, make the changes and maintain yet another repo. This, in my opinion, should be avoided.
> 
> Please let me know what you think about it. 

My perspective here is:

1) You can do this by checking in your Packages directory, once this is a supported feature (which is intended) SwiftPM will warn that your Packages directory differs from that of upstream.
2) You can fork and change which fork is used as per our lockfile proposal

How do these options sound?


More information about the swift-build-dev mailing list