Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #96 +/- ##
==========================================
- Coverage 76.90% 76.90% -0.01%
==========================================
Files 66 66
Lines 17065 17064 -1
==========================================
- Hits 13124 13123 -1
Misses 3941 3941 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds Swift support for FlowSDK via UniFFI-generated Swift/C bindings, including an SPM package layout, example clients, and CI verification to ensure bindings can be generated and compiled.
Changes:
- Add UniFFI-generated Swift bindings (
FlowSDK) and C bridging header target (flowsdk_ffi) for Swift Package Manager. - Add Swift TCP + QUIC example executables and a Swift README with build/run instructions.
- Add
scripts/build_swift_bindings.sh, CI job to generate+build Swift, and.gitignoreentries for Swift build artifacts.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
swift/Sources/flowsdk_ffi/flowsdk_ffi.h |
Adds generated C FFI header for Swift bridging target. |
swift/Sources/FlowSDK/flowsdk_ffi.swift |
Adds generated Swift UniFFI bindings exposing the Rust API to Swift. |
swift/Package.swift |
Defines SPM package targets/products for the bindings + examples. |
swift/README.md |
Documents generating bindings and building/running Swift examples. |
swift/Examples/TcpClientExample/main.swift |
Adds a TCP MQTT example that drives the engine with POSIX sockets. |
swift/Examples/QuicClientExample/main.swift |
Adds a QUIC MQTT example that drives the engine with UDP sockets. |
scripts/build_swift_bindings.sh |
Adds script to build Rust + generate/distribute Swift bindings, optionally verify build/XCFramework. |
src/mqtt_client/engine.rs |
Refactors QUIC Connected event handling using a match guard. |
examples/no_io_tokio_quic_client_example.rs |
Refactors match arms using guards for subscribe/publish flow. |
.gitignore |
Ignores Swift build outputs, generated artifacts, and Python egg-info. |
.github/workflows/ci.yml |
Adds a macOS Swift bindings job and extends target matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let rc = Darwin.connect(fd, ai.pointee.ai_addr, ai.pointee.ai_addrlen) | ||
| if rc < 0 && errno != EINPROGRESS { | ||
| fatalError("connect() failed: \(String(cString: strerror(errno)))") | ||
| } | ||
| return fd |
There was a problem hiding this comment.
This example is intended to work on macOS/Linux, but it calls Darwin.connect(...). On Linux (Glibc) the Darwin module isn't available, so this won't compile. Use connect(...) directly (or conditionally call Darwin.connect vs Glibc.connect).
| retention-days: 7 | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 |
Description
Please include a summary of the changes and which issue is fixed. Please also include relevant motivation and context.
Fixes #(issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Checklist:
Performance Impact
Security Considerations