libwally-swift icon indicating copy to clipboard operation
libwally-swift copied to clipboard

Add Swift Package Manager Support

Open jurvis opened this issue 3 years ago • 5 comments

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 avatar May 05 '22 03:05 jurvis

@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.

jurvis avatar May 05 '22 03:05 jurvis

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.

Sjors avatar May 09 '22 11:05 Sjors

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?

jurvis avatar May 09 '22 16:05 jurvis

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

Sjors avatar May 09 '22 18:05 Sjors

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 😄

jurvis avatar Aug 05 '22 18:08 jurvis