Swift and dart bindings tests in ci#1706
Conversation
thesimplekid
left a comment
There was a problem hiding this comment.
Nice. I think this is generally in the right direction though I didn't try to run anything.
ec78b29 to
6199ed5
Compare
|
I notice the flake.lock is not changed after adding the dart overlay. This could be what is causing the rate limiting as this needs to be updated. |
6199ed5 to
fc1ff7f
Compare
8df4da8 to
67b7988
Compare
497e283 to
2adf0f4
Compare
2adf0f4 to
da4c41c
Compare
3ed1270 to
9e53728
Compare
|
Should fix the swift. #1784 |
18be5d3 to
96e4e6f
Compare
Introduce Dart/Flutter bindings generated via uniffi-dart, including: - Flutter example wallet app with mint, send, and receive flows - WalletStore enum (Sqlite/Postgres/Custom) replacing separate constructors, allowing both built-in Rust backends and foreign callback implementations through a single `new()` constructor - Justfile targets for building and running Dart bindings - Post-generation patches for uniffi-dart codegen issues
- Add Swift binding generation via UniFFI for iOS, iOS Simulator, and macOS - Include generate-bindings.sh script that builds universal XCFramework with support for aarch64-apple-ios, aarch64-apple-ios-sim, and aarch64-apple-darwin targets - Add Swift wrapper (CashuDevKit.swift) generated from cdk-ffi crate - Add Swift example project demonstrating wallet creation, minting, melting, and multi-mint wallet usage - Include Info.plist resources for iOS, iOS Simulator, and macOS frameworks - Add UniFFI bindgen configuration (uniffi.toml) and Swift bindgen binary - Update justfile with swift-bindings and swift-example tasks - Update Dart bindings: regenerate FFI bindings, add generate-bindings.sh, update flutter_example dependencies - Bump cdk-ffi uniffi dependency to version 0.29
- Consolidate uniffi version (0.30) in workspace root Cargo.toml - Replace per-crate version pins with workspace = true in cdk-ffi, cdk-ffi-swift, and cdk-ffi-dart - Apply rustfmt formatting to dart bindings codegen and FFI sources - Update Cargo.lock.msrv with resolved dependency versions
- Remove the Flutter example app and Swift example app - Add Dart unit tests (wallet_test.dart) and Swift tests (CdkTests.swift) that verify wallet initialization, zero balance, and mint flow against testnut.cashu.space - Add CI jobs for Dart and Swift binding tests on self-hosted/macOS runners - Add nix `bindings` devShell with Dart SDK, OpenSSL, and stable Rust toolchain (including Apple cross-compile targets) - Fix Dart build hook to forward full parent environment to cargo and extract OpenSSL paths from NIX_CFLAGS_COMPILE/NIX_LDFLAGS as fallback - Update justfile: replace `example-dart`/`example-swift` with `test-dart`/`test-swift` recipes
…ndoring Use the stable toolchain (craneLib) instead of MSRV toolchain for vendoring dependencies, since cargo 1.85.0 does not support --exclude-lockfile needed by crane to package git dependencies like uniffi-dart. Also exclude cdk-ffi-dart and cdk-ffi-swift from MSRV workspace builds as their dependencies (uniffi-dart) require a newer Rust toolchain.
uniffi-dart generates the Record class as P2pkSigningKey (camelCase) but references it as P2PKSigningKey in callback interface methods and sequence/optional converters, causing Dart compilation errors. Normalize all occurrences to P2pkSigningKey in the post-generation patch.
The swift test runner requires a Package.swift at the repo root, but it depends on build artifacts from the XCFramework generation step. Generate it in the pipeline rather than committing it to the repo.
96e4e6f to
f444745
Compare
f444745 to
c7c76f8
Compare
Add WalletStore factory functions (sqliteWalletStore, postgresWalletStore, customWalletStore) so downstream consumers don't need to construct enum variants directly. Document the UniFFI limitation that requires the enum wrapper instead of accepting trait objects as parameters. Document all five uniffi-dart codegen patches in patch_generated() to explain what each fixes and why it's needed.
There was a problem hiding this comment.
Thanks for this. I think this is good to merge now. I did leave some more comment where I think we can improve this a bit more but lets do that as a follow up to keep things moving.
@crodas If you could look at the comments and make issues out of the ones that make sense so they can addresses that would be great.
There was a problem hiding this comment.
Im not sure we need the full XC framework and IOS stuff since we're not releasing from here and only want to run a smoke test of the building and running tests of swift bindings on macos runner.
Description
Prototype to have a monorepo for all the bindings
Closes: #1539, #1670
Notes to the reviewers
Suggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
Checklist
just final-checkbefore committing