Sjors / libwally-swift

Swift wrapper for LibWally, a collection of useful primitives for cryptocurrency wallets
MIT License
40 stars 18 forks source link

Add Swift Package Manager Support #77

Open jurvis opened 2 years ago

jurvis commented 2 years ago

Essentially what is wip in #73

I recently found out that Swift 5.4 added extensible build tools to Swift Package Manager, which will allow us to support deterministic builds with Swift Package Manager, since we can use it to call our external build script to build the C static libs.

For some reason this isn't documented in the official docs for the package manifest. 🤷

jurvis commented 2 years ago

@Sjors I have a couple of exams lined up and will have sparse availability over the next week, but I'll work on this during my spare time.

Sjors commented 2 years ago

Thanks!

I'm still very reluctant about binary releases, but we could make them available with a giant disclaimer that people should stick to CocoaPods until there's a source distribution.

jurvis commented 2 years ago

some update here: looks like I misunderstood how that Swift evolution proposal works. It's mostly for using tools like SwiftGen to generate swift code.

I put a post up on the Swift forums to gather some thoughts, but based on the replies (N=1) so far, and my separate conversations with friends, it doesn't look like source distribution with SwiftPM is currently possible.

Disclaimer sounds good, my goal for now is to write an additional GitHub action that builds the xcframework and creates a release on tag. What do you think?

Sjors commented 2 years ago

That sounds good to me. For developers using the binary it means trusting Github instead of trusting me, which is no worse :-)

jurvis commented 2 years ago

apologies for stalling on this. we learned a ton about how to do this nicely over at https://github.com/lightningdevkit/ldk-swift, and I'll find some way to bring them over to libwally-swift at some point.

Probably will be a lot easier since we're building libwally-core from C, not Rust 😄